Insert tuning

  • Hi experts,

       I have a table only 250 MB which stores image files and the ID is the key (Cluster Index on this key).  However, user complains the inserting is very slow sometimes. 

    Where should I start to tune the insert activities?  A profiler? trace? or .....

    Thanks.

  • How big are these image files?

    If someone is uploading a huge image file then that will impact on other users.

    Do you have some form of created or updated date on your image records?

    If so get your users to log when they think there is a problem and then look at the records for that particular time frame.

    The reason I suggest such a non-technical solution is because user perception is not always fact.

  • Could also be your implementation, which is generally the case more then the DB.

  • Is the ID auto generated by SQLServer? If the ID is not being generated automatically by the system, then are the ID's being inserted in a fairly sequencial order? If they are coming in a somewhat random order, then SQL is having to constantly restructure your table to put in in physical order or your clustered index.

  • Hi jennifer,

    If you placed the image data on some other file group (using the TEXTIMAGE_ON option of CREATE TABLE command) try this: check what is the most frequent size of images inserted in the table. If it is up to 7,000 bytes, you can investigate the "text in row" table option in BOL. Basically, it will provide in-row storage of small images, instead of putting them on a separate location.

    HTH,

    Regards,

    Goce.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply