Query delay


  • Hi all, I need help with a problem than I have in SQL Server 2005. I'm
    executing a query with several joins, and when I execute the query It delay 6 minutes.
    The strange thing, It's that when I reinsert all the rows in one of the tables, the query delay only 10 seconds.
    Actually every day I have a process that it insert new records in this table, and It's
    when this process happens, when my query delay 6 minutes again.

    Do anyone has an idea that could happen?

    Thanks very much in advance.

    Monday, April 02, 2012 1:45 PM


  • the SQL Server does never "delay" in a query - it may be possible that it is blocked by some locks or it does a lot of disk I/O.

    Could it be that the records in one of the tables does change a lot and there're not helpfully indexes configured?

    What happened if you execute the query a second time just after the first execution without inserting rows into one of the tables?

    Take a look at the current execution plan when executing the query

    Monday, April 02, 2012 5:13 PM