Hi, I have an SQL query which is doing a select joining several tables based on certain conditions. There are 35 joins and 35 conditions. We are using SQL Server 2005. The problem is that this particular query is taking unusally long time (17 hrs) to execute in the production server whereas the same query used to take only 10 minutes to execute in previously since years. We are exploring whether what could have gone wrong all of a sudden. What could be the probable reasons and what should I investigate. Any suggestion is highly appreciated. Thanks in advance. Sagar.
stats out of whac? try reindexing all the tables and doing an update stats with full scan and then run the query. You can see the query plan and identify the tables that need to be reindexed first....
Hi, Thanks for the reply. I have executed Update Statistics for each table with Fullscan and ran the query but still takes a long time and returns no rows. All the tables are indexed and are on Production server, so reindexing these tables should be done?? Help needed to troubleshoot in this regard. Thanks, Sagar.