Are Bad Statistics Making My Query Slow?
About this episode
An important query is suddenly slow. Is it because statistics are out of date? This is tricky to figure out, and updating statistics right away can make troubleshooting even harder. Learn how to use query execution plans to get to the heart of the question and find out if stats are really your problem, or if it's something else. In this 35 minute episode:
00:39 SQL Server 2017 Announced
01:10 New video from Microsoft's Joe Sack demonstrating Adaptive Query Processing
03:05 This week's question: Are bad stats making my query slow?
05:26 Demo of finding plan in cache and analyzing stats begins
28:17 What to do when stats ARE the problem
Code samples: https://gist.github.com/LitKnd/f07848d59cedc61fd057d12ab966f703
Links from the episode:
SQL Server 2017 Adaptive Query Processing video by Joe Sack: https://www.youtube.com/watch?v=szTmo6rTUjM&feature=youtu.be
Michael J Swart on finding Dark Matter Queries: http://michaeljswart.com/2017/04/finding-your-dark-queries/
Got a question for Dear SQL DBA? https://SQLWorkbooks.com/ask
More from Dear SQL DBA
Erik Darling joins Kendra to chat about AI tools, why they work better for Python and PowerShell than SQL, and what's exciting (and what's not) in SQL Server 2025. Along the way we describe the ONE TH…
Erik Darling joins Kendra Little to rate different SQL Server Performance Tuning Techniques in episode 81 of the Dear SQL DBA podcast. We share our opinions of... (deep breath) Recompile hints, Query…
Eugene Meidinger stops by to chat about Power BI Performance Tuning with Kendra. We talk about the various engines and languages used in Power BI and big-picture strategies for getting performance fro…
In this episode, Michael J Swart joins the Dear SQL DBA podcast to talk about databases, automation, and how he's come to illustrate some of the coolest blog posts ever to be written about data. Check…
SQL Server has a new feature that's currently only available in Azure SQL Database: Optimized Locking. Jeremiah Peschka joins the podcast to talk through the docs and nerd out on locks, blocks, and ho…