There are lots of examples of how to do this with the plan cache, but, well, the plan cache can be an awfully unstable place.
Read the post: Finding Queries With Multiple Plans In Query Store
AI Training for Database Teams and SQL Server Performance Tuning
There are lots of examples of how to do this with the plan cache, but, well, the plan cache can be an awfully unstable place.
Read the post: Finding Queries With Multiple Plans In Query Store
This metric gets looked at a lot in the plan cache to see how effective it is. The main problem is that with high enough churn, you might not catch all the…
Over the years, there have been a lot of requests to get sp_BlitzCache to sort results by query cost. I understand why.
Read the post: Why You Should Stop Looking At Query Costs In SQL Server
THREADPOOL waits do not show up in Query Store, even when a workload clearly hits them. After purging Query Store and restarting SQL Server 2019, I ran a…
There are some oddities in the documentation for query store wait stats.
Read the post: Wait Stats SQL Server’s Query Store Doesn’t Actually Track
Performance troubleshooting output in a stored procedure is far easier to use when each query's runtime sits next to its plan.
Read the post: sp_QuickieStore Improved Performance Troubleshooting
A public stored procedure needs verbose debugging so users can file GitHub issues with enough detail to fix.
sp_QuickieStore accepts lists of plan IDs and query IDs to include or ignore, but deliberately not a list of databases, because querying even one…
sp_QuickieStore has a troubleshoot_performance parameter, a bit that defaults to 0 so the logging overhead stays off unless you ask for it.
Error handling in a long dynamic SQL procedure works best when the CATCH block reports where it was and what it ran, and THROW does that more reliably than…
Dynamic SQL stays safe when object names go through QUOTENAME and every user value is passed as a parameter through sp_executesql, never concatenated into…
I’ve been working on scripts like this for long enough to know that I don’t know everything that might happen out there in your kooky-krazy environments.
Read the post: Introducing sp_QuickieStore: What To Do If You Hit A Problem
Sometimes it’s hard to get people to understand the scale of a number without some commas.
Read the post: Introducing sp_QuickieStore: Formatting Is Everything
What good is writing all this dynamic SQL and whatnot if you’re just going to firehose data at people?
Read the post: Introducing sp_QuickieStore: What You Can Filter
There are two ways to run sp_QuickieStore for your chosen database that alter the total results you get back.
Read the post: Introducing sp_QuickieStore: What The Results Show You
If you’ve ever tried to write a query to find stuff in Query Store and quickly gotten frustrated, you’re not alone.
Read the post: Introducing sp_QuickieStore: Find Your Worst Queries In SQL Server’s Query Store
When I was checking out early builds of SQL Server 2019, I noticed a new DMV called dm_db_missing_index_group_stats_query, that I thought was pretty cool.
Read the post: Documentation for dm_db_missing_index_group_stats_query
It clears out a lot, plans aren’t there for some queries, and the plans that are there can be very misleading.
Read the post: Why Microsoft Should Get Rid Of SQL Server’s Plan Cache And Use Query Store Instead
Query Store cannot force a plan across queries with different literal values, because each literal gets its own query ID even when SQL Server gives them…
Read the post: Query Parameterization and Plan Forcing Gotchas In SQL Server
Back when I first wrote sp_BlitzQueryStore, I was totally enamored with Query Store.
Read the post: For Better Query Store Adoption, Make Querying It Faster And Easier
In the documentation for TOP, the following is listed as a best practice:
Read the post: SQL Server T-SQL Protip: watch those TOPs without ORDER BY
Copyright © 2019-2026 Darling Data