Deadlock victim selection decides which of two blocked transactions SQL Server rolls back. This post shows the rules, sets DEADLOCK_PRIORITY on one procedure, reproduces a deadlock with two query windows, and shows what the setting cannot do. It ends with the two fixes that remove the deadlock itself.
Execution Plan Wait Stats: Read Them in SSMS and XML
Execution plan wait stats list what one execution of a query waited for, so you don’t have to guess from server-wide totals. This post shows where to find them in SSMS and in the plan XML, reproduces a lock wait with two query windows, and explains the common wait types. It ends with Query Store, which keeps wait totals for many queries.
Multiple Aggregates in One Query: Read the Table Once
Multiple aggregates in one query read a table once, where separate subqueries read it again and again. This post measures the logical reads of two subqueries against one SELECT, uses CASE inside SUM for different filters, and shows two cases where the rewrite gains nothing or loses to an index.
LPIM Memory Model: Check It With sys.dm_os_sys_info
The LPIM memory model tells you whether SQL Server runs with locked pages. This post reads it from sys.dm_os_sys_info in one query, confirms it with the process memory view and the error log, and explains what each value means.
SQL SERVER – Queries Waiting for Memory Grant – Performance Tuning
Queries Waiting for memory grants give me evidence to investigate. A customer CTO requested that evidence before approving more RAM.
QDS_LOADDB Wait: Slow Startup and Query Store Load
A QDS_LOADDB wait means a database waits for Query Store to load its data at startup. This post reads the wait, checks the size of a store, explains the trace flag that loads Query Store asynchronously, and shows the settings that keep a store small.
Partition Function Fanout: Count Partitions in SQL Server
Count partitions in SQL Server by reading the fanout of a partition function. This post reads fanout and modify_date from sys.partition_functions, watches SPLIT RANGE and MERGE RANGE change them, and finds functions that no table uses.







