Performance

MSSQL Query running fast in production and slow in non-production

Advertisements

 Query running fast in production and slow in non-production

I have asked to look one of the queries that run fast in production and slow in non-production.

Question asked – how long it took to complete the results. It is about 1.50 minutes in non-production, but in production it completed less than 5 seconds.

Got the code and run myself in SSMS to compare the plan, since it will finish 1.50 minutes. It quickly showed estimated number of rows are totally different. This could be either out of stats or data skew.

 

I just checked the last stats update and updated the stats that fixed the issue.

You can easily compare execution plan in SSMS.

 

Stats-issue

I’m currently working as a SQL server DBA in one of the top MNC. I’m passionate about SQL Server And I’m specialized in Administration and Performance tuning. I’m an active member of SQL server Central and MSDN forum. I also write articles in SQL server Central. For more Click here

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

34 + = 43