some time query took little bit long time!!!

  • Hello friends!!

    I observe that sometimes my queries took 2 0r 3 sec and sometimes it took 1.30 min or 2 mins

    that might be problem due to some other user access same table or view??

    already i optimised my query but still it took sometimes little bit long time!

    if soem other user access the same table then is there any process to lock the table or waiting option ????

    please help me out!!!

    T.I.A

    Shashank


    Regards,

    Papillon

  • Run the query several times, while other users are on the system. If the query takes longer than 10 seconds, open another Query Analyzer window.

    Run sp_who2.

    That will show you who is blocking you.

    Run DBCC inputbuffer (spid number of the blocker) to see what is being done that is blocking you.

    BTW this is not a DTS question! You probably would get more, and better responses if it was properly posted.

  • You can alleviate some of the blocking by using a (nolock) hint in your query

  • It could also be a problem with a bad execution plan so check what that is when the query is running slowly and do more tuning as need be.

    Another useful subject to look up is parameter sniffing.

     

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

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