How to See Rowcounts and Execution Time for In-Flight Queries in SQL Server
I frequently need to see rowcounts and execution time for queries while they’re running. Maybe I’m troubleshooting a slow query …
Read MoreBy Kendra Little on • 5 min read
Psssttt – I have an updated blog post on this called the Learner’s Guide to SQL Server Performance Tuning
The SQL Server is slow, what should you do? I answer a reader question and share my strategy for performance troubleshooting.
Dear SQL DBA,
is there any step-by-step script that you would use to start your troubleshooting? My production SQL Server has a problem with memory pressure. Page Life Expectancy is low and lazy writes are high. I heard that Microsoft engineers will use SQL Diag then Nexus to troubleshoot, but I have not had success using those tools.
Lost in Performance Troubleshooting
Tools change over time - for example, Query Store is a huge new tool in SQL Server 2016 (awesome!)
When things are slow, I want to know three things:
What queries are running, how long have they been running, and what are they waiting on?
What are the overall waits for the time period?
And never ever skip….
Sanity check examples:
I’m recommending looking at waits in two out of three steps:
Waits are critical to performance because it’s SQL Server’s way of explaining, “What made this slow?”
Waits are overlooked because they can be confusing to decode, and it takes time to learn to interpret them.
Waits are worth the effort because…
What is running? Look at the duration and waits
What are things waiting on? In a memory pressure situation, I’d expect to see…
You can’t always be there when the SQL Server is slow.
Plus, you need a baseline of waits. (This is hard enough without knowing what’s normal!)
Specialized SQL Server monitoring tools collect wait information.
There’s also free tools out there you can use, but you need to make sure you don’t impact the system too much.
Several fine paid vendor tools work to provide all of these things for you in one interface. I’m talking about the free ones here.
Waits Reference - Paul Randal’s SQL Server Wait Library: https://www.sqlskills.com/help/waits/
The new Query Store feature doesn’t collect wait statistics
And hey, who knows if Query Store might start to collect waits as well in the future … or if it might have a Wait Store friend? (No secret knowledge here, just a wish… because that would be awesome.)
Copyright (c) 2025, Catalyze SQL, LLC; all rights reserved. Opinions expressed on this site are solely those of Kendra Little of Catalyze SQL, LLC. Content policy: Short excerpts of blog posts (3 sentences) may be republished, but longer excerpts and artwork cannot be shared without explicit permission.