APPROX_COUNT_DISTINCT counts distinct values with almost no memory. Tested on 5 million rows, it was within 2.2 percent of the exact count and needed no memory grant, while COUNT(DISTINCT) asked for 436 MB. It was not faster.
Adaptive Joins: When the Plan Picks Its Join at Run Time
Understand adaptive joins in SQL Server, read their runtime threshold, inspect the actual choice, and test a query hint safely.
user_lookups: Verify the Plan Before Adding Coverage
user_lookups helps identify where to investigate missing coverage. Compare complete query results and actual plans before adding included columns. Weigh the read benefit against storage and write costs.
Storing Images in SQL Server: varbinary(max) or FILESTREAM
Pictures in a database are easy to insert and easy to regret. Here is where the bytes go and how to choose a storage method.
Operator Cost Percentages Are Estimates: Read Actual Time Instead
Read operator cost percentages as estimates, then use actual rows, elapsed time, IO, and repeated work to find the real bottleneck.
Leading Wildcard LIKE Searches: Why They Scan and What Helps
Diagnose a leading wildcard LIKE scan and compare prefix search, reversed suffix keys, full-text search, and n-gram indexing.
Five DMVs Worth Memorizing
Five DMVs worth memorizing show SQL Server sessions, active requests, waits, index use, and file I/O during an incident.







