Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

Slow or long running query troubleshooting.

$
0
0

We had a situation where an SP/Query is running very long (~ 3 hours) on production server (32 CPU + 64 GB) . As this SP is taking only 2 to 3 min in QA environment we started troubleshooting. 

Analysis

1) verified index fragmentation, index stats & cached plan - All looks good. 

2) Recompile the SP - but no success.

3) Finally to repro the issue we copied all the production DBs to a staging server (8 CPU + 8 GB RAM) using backup/restore process and executed the same SP which completed in 2 to 3 minutes. I have run the wait statistics and got following data,

wait stats

Could someone please suggest me the right way of finding the issue ... why this SP is running longer in high configuration production environment ? 

Server Config: Windows 2008 SP1 / SQL Server 2012 SP1

Thank you




Viewing all articles
Browse latest Browse all 12963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>