Help with Strange Situation | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Help with Strange Situation

Hello, I have a very complex SQL statement that I run against my prod SQL DB in Query Analyzer that just takes forever and sometimes does not finish. When I run it against Development SQL DB in QA, it takes only 20 seconds. I copied over all the tables in the SQL from Prod to Dev. They are identical. I am lost as to what is going on and why this is happening. I verified there is nothing else running on the server at that time, I just can’t figure out why it won’t finish on production. What else is different that I can check in settings? Does anyone know what else I can do to test? Thanks.
Are the servers identical? Are the raid levels on the drives the same? Is one database simple recovery and the other full? What type of sql are you doing – selects only, data modification etc? Can you check in QA, that each are using the same execution plan.
Did you run Update Statistics in low server?
Luis Martin
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.
Check execution plans of both dev and production to determine if they differ.

Luis, Bingo! I ran the update stats SP and now the query runs properly. I will now look to run this automatically every night or once a week. As always, you guys came through for me again! I really, really appreciate the input. Thanks for helping me grow as a DBA. There really is a lot to learn. Rodney
Its better to schedule a job to manually update stats or DBCC DBREINDEX in order to update the statistics on all the tables for performance gain. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>