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,
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