Query-Performance

Category: query-performance

Erik Darling and Kendra Little Rate SQL Server Perf Tuning Techniques

Erik Darling and Kendra Little Rate SQL Server Perf Tuning Techniques

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 Store hints and plan forcing, CTEs, Resource Governor, the legacy cardinality estimator, Table Variables, Automatic Plan Correction, Batch Mode, index rebuilds, Hekaton, NOLOCK, page compression, partitioning, filtered indexes, columnstore, join hints, PSPO, indexed hints, indexed views, optimize for unknown, RCSI, adding more memory, restarting the damn thing, scalar UDFs, and Persisted Memory Grant Feedback.

Continue reading

Learn Perf Tuning in 2 Days at PASS Summit 2024 With Erik Darling and Kendra Little

Learn Perf Tuning in 2 Days at PASS Summit 2024 With Erik Darling and Kendra Little

I’m teaming up with Erik Darling to teach you SQL Server Performance Tuning in two days at the PASS Data Community Summit in Seattle.

Erik and I are co-teaching both days of training to give you a strong strategic background on the internals you need to know, along with critical tactical performance tuning techniques. Join us to level up your perf tuning skills!

Continue reading

Query Store Size Based Cleanup Causes Performance Problems - How to Avoid It

Query Store Size Based Cleanup Causes Performance Problems - How to Avoid It

I’m a huge fan of SQL Server’s Query Store feature. Query Store collects query execution plans and aggregate query performance metrics, including wait stats. Having Query Store enabled makes troubleshooting performance issues such as bad parameter sniffing, much, much easier. Because Query Store is integrated into SQL Server itself, it also can catch query plans in a lightweight way that an external monitoring system will often miss.

When performance matters, it’s important to ensure that you’re managing Query Store so that Query Store cleanup does not run during high volume times. Query Store cleanup could slow your workload down significantly.

Continue reading

You Will Not Find Long Compilers Who Time Out in Query Store

You Will Not Find Long Compilers Who Time Out in Query Store

Last November, a puzzle was really bothering me. Some queries from an application were timing out frequently after running for 30 seconds, but they were halfway invisible in the SQL Server.

Continue reading

Automatic Plan Correction Could Be a Great Auto Tuning Feature for SQL Server: Here Is What It Needs

Automatic Plan Correction Could Be a Great Auto Tuning Feature for SQL Server: Here Is What It Needs

🔥 UPDATE: The sys.sp_configure_automatic_tuning stored procedure is now documented and supported by Microsoft. Thanks to the SQL Server Product team for this improvement.

I’ve written a bit about SQL Server’s Automatic Plan Correction feature before– I have an hour long free course with demos on Automatic Plan Correction here on the site.

Today I’m updating that course with a note: after using Automatic Plan Correction in anger for a good amount of time, I do not recommend enabling the feature. I’ve had it cause too many performance problems, and there are not a ton of options for an administrator when it’s causing those problems.

Meanwhile, becoming reliant on the feature for the places where it does help makes it difficult to disable the feature. You end up stuck with a very weird set of problems that are oddly similar to the problems the feature was designed to solve.

Further investment in the feature could solve these problems and make this a great tool for customers. Here’s a run down of what Automatic Plan Correction needs from a user who has suffered from it.

Continue reading

Jer and Kendar Explore Optimized Locking

Jer and Kendar Explore Optimized Locking

🔥 UPDATE (November 2025): Microsoft has introduced optimized locking v2 with significant improvements. The new version includes Skip Index Locks (SIL) and Query Plan LAQ Feedback Persistence, which further reduce lock overhead. The improvements are most pronounced for nonclustered indexes. Optimized locking v2 is available in SQL Server 2025 and Azure SQL.

SQL Server has a new feature that’s currently only available in Azure SQL Database: Optimized Locking.

Jeremiah Peschka joins Kendra (aka Kendar) to talk through the docs and nerd out on locks, blocks, and how to pronounce the acronym “LAQ”.

Prefer to explore optimized locking with a diagram? I’ve also got a little sketchnote for ya.

Continue reading

Dear SQL DBA - Performance Tuning with Erik Darling

Dear SQL DBA - Performance Tuning with Erik Darling

By Kendra Little on August 18, 2023

SQL Server performance tuning expert Erik Darling joins the podcast today to chat about how good queries can go bad and how bad queries can get better.

He also answers the question on everyone’s mind: if he was a database, what database would he be?

Continue reading