When a parallel query's CPU time roughly equals its elapsed time, the plan is probably skewed and not using its threads.
Read the post: The SQL Server Performance Tasting Menu: Performance Issues With Parallel Query Plans
AI Training for Database Teams and SQL Server Performance Tuning
When a parallel query's CPU time roughly equals its elapsed time, the plan is probably skewed and not using its threads.
Read the post: The SQL Server Performance Tasting Menu: Performance Issues With Parallel Query Plans
DISTINCT adds extra work that EXISTS and NOT EXISTS avoid, and it gets expensive across many columns.
Read the post: The SQL Server Performance Tasting Menu: How DISTINCT Queries Can Hurt Performance
Wrapping a column in a function, such as DATEDIFF on a date column in a WHERE clause, forces SQL Server to evaluate every row and prevents an index seek.
An OR in a join condition can make SQL Server run an index seek millions of times, and splitting it into UNION ALL fixes that.
An update whose source values come from the table being modified makes SQL Server add an eager table spool for Halloween protection, and staging the data…
A row mode bitmap helps only when it removes rows early, and you can judge that by comparing rows read with rows leaving the scan.
SQL Server can copy a predicate to both sides of a join, but it fails when an OR condition spans columns from two different tables.
SQL Server does not allow COUNT(DISTINCT) with an OVER clause and throws an error immediately, so counting distinct values per partition needs a rewrite.
Read the post: The SQL Server Performance Tasting Menu: How To Count Distinct Values In SQL Server
Optional-parameter search procedures are slow and, when written with concatenated dynamic SQL, open to SQL injection that steals data.
A read query can block a write query when its plan has a key lookup, because the lookup holds a shared lock on the clustered index until the query…
Better indexing makes better use of the buffer pool, and unused or near-duplicate indexes waste it.
A sort's memory grant grows with the number of rows and the width of every column you select, not only the ORDER BY column.
Read the post: The SQL Server Performance Tasting Menu: How Memory Grants Work
Table variables can beat temp tables when code runs at very high frequency on few rows and plan shape does not matter, but column-level statistics make…
A missing index request can be technically correct and still harm a workload, so correlate it to the query that asked for it and apply workload knowledge…
Rowstore index key order lets you avoid Sort operators, and sorts matter because they ask for memory grants sized by rows and column width, block inside…
Read the post: The SQL Server Performance Tasting Menu: How Sorts Can Hurt Query Performance
A CTE is not materialized, so every reference re-runs its query, and CTE versus temp table is not a real either-or choice.
A trivial plan means SQL Server had no cost-based choice to make, and it skips optimization phases that would help you.
Read the post: The SQL Server Performance Tasting Menu: How Trivial Plans Can Hurt Query Performance
Multi-statement table-valued functions inherit the defects of table variables, because a table variable drives them.
Copyright © 2019-2026 Darling Data