Statement Duration

  • I have a query which used to run in 1 sec during last week but now its taking 10 sec....I didn't make any changes....what are the best places to look for to improve the performance???(also the statement executions on that query increased)

  • Your query hasn't changed, but maybe data did.

    Are data volumes the same?

    Are statistics up to date?

    There's lots of things you could look into, I just named the first ones that came to my mind.

    -- Gianluca Sartori

  • Yep, I agree with Gianluca, probably statistics.

    It's also possible that you're seeing parameter sniffing. You'd want to look at the execution plan of the query to see what it's doing. Since you probably don't have last week's execution plan you can't compare, but if you see performance improve, compare the execution plan when it's faster to when it's slower and see what things look like.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply