A Simple Select, Update Query with where condition is taking much time

  • Hi,

    In production database, i have few tables which are consuming much time or it goes out with time out for a simple select and update queries. Please suggest what and all i need to check and what has to be done to resolve this. As these fetching takes more time, the application gives time out error.

    I have restarted the sql server and agents. I also tried with taking a full backup of the database, even after it has the same problem. Please suggest what and all i have to do to get rid out of this.

    With Regards

    Dakshina Murthy

  • Hi,

    There may be no of reasons why it is happening.

    1. Do you have indexes on those tables.

    2. When did you update your indexes and statistics last.

    3. Do you have any other processes or blockings while select or update is going on these tables

    4. Did you study the query plan . you can find out what exactly is happening in your query plan if you dont have any blockings etc..

    Thanks

    Chandra Mohan N

    [font="Verdana"]Thanks
    Chandra Mohan[/font]

  • 1. Do you have indexes on those tables.

    Answer: Yes we do have indexes on these tables,

    2. When did you update your indexes and statistics last.

    Answer: I have rebuild these indexes now.

    3. Do you have any other processes or blockings while select or update is going on these tables

    Answer: How to check whether any processes of blockings while select or update is going on these tables.

    4. Did you study the query plan . you can find out what exactly is happening in your query plan if you dont have any blockings etc..

    Answer: No, i havent studied the query plan. Please let me know how to study the execute plan.

    Thanks for the help.

    With Regards

    Dakshina Murthy

  • Hi,

    I am sorry to say that there may be some other problems too like locking mechanism etc... as this is performance related problem. Just check out sp_who2 while this is executing. And also are there any backup jobs or any other jobs executing in the background while this is happening. Studying execution plan will take more time but let me tell you this is the best one for beginners

    http://www.sqlservercentral.com/articles/Administering/executionplans/1345/

    http://www.sql-server-performance.com/tips/query_execution_plan_analysis_p2.aspx

    Thanks

    Chandra Mohan N

    [font="Verdana"]Thanks
    Chandra Mohan[/font]

  • Hi,

    Thanks a lot for the guidance and showing the way to learn, i am really happy, definitely i will read this.

    Thank you very much

    With Regards

    Dakshina Murthy

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

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