A composite index orders rows by its leading key before the next key. Compare a date-only filter, region restrictions and an isolated date-first index. Verify complete results, including new regions and NULL, before interpreting actual plans.
Prefix Searches: LIKE, LEFT and CHARINDEX
LIKE, LEFT and CHARINDEX can match the same prefix through different access paths. Compare complete matching rows and measured plans, then test literal wildcard characters and collation before choosing a search expression.
Pre-Aggregating Data for Fast Dashboards
Pre-aggregating data can make dashboards fast through summary tables or indexed views when grain, refresh, and reader consistency are clear.
Finding the Slowest Statement Inside a Stored Procedure
Find the slowest statement inside a stored procedure using query stats offsets, CPU and read totals, then confirm with Query Store.
ALLOW_PAGE_LOCKS OFF Stops REORGANIZE
ALLOW_PAGE_LOCKS OFF prevents a rowstore index from being reorganized. A controlled example shows the maintenance error, checks the index setting and verifies that enabling page locks allows REORGANIZE without changing the stored rows.
Raising a Database Compatibility Level Safely
Raise a compatibility level safely by capturing a Query Store baseline, changing one database, comparing plans, and keeping a tested reversal.
Calculating the Cost of a Slow Query
Cost of a slow query includes frequency, CPU, reads, waits, and user time; learn to turn SQL Server measurements into a practical tuning priority.







