I recently asked on Twitter an exciting question about OR vs IN. While I got lots of good answers, there were an equal amount of wrong answers.
SQL SERVER – The Comprehensive Guide to STATISTICS_NORECOMPUTE
One such feature that plays a pivotal role in managing your SQL Server databases’ performance is the STATISTICS_NORECOMPUTE option.
Performance Tuning Mistakes in SQL Server: 11 Habits to Fix
Performance tuning mistakes are habits, and each one has a check. Eleven sit in one table, and five are measured on a demo database: a missing index, stale statistics, a row by row loop, a giant delete and a type that cannot be indexed.
SQL SERVER – Measure Index Performance
I measure index performance against the same workload before and after a change. A customer wanted to assess a new index.
SQL SERVER – Stored Procedure Timing and Cached Measurements
SET STATISTICS TIME reports CPU and elapsed execution time for Stored Procedures. A customer wanted to measure a run without adding statements manually.
rows_sampled: Checking How Much Data Your Statistics Saw
A fresh statistic can still come from a small sample. Compare rows with rows_sampled and see how a sample misjudges a rare value.
Maximum Columns in an Index: 32 Keys and the Way Around
The maximum columns in an index is 32 key columns, and a second limit on key size can stop an index earlier. This post builds a 40 column table, shows the error for a 33rd key column, and adds included columns to get around it. It also shows the 900 and 1,700 byte key limits and tests statistics on 33 and 40 columns.







