To rebuild all indexes on a table, right-click the Indexes folder in SSMS and choose Rebuild All, or run ALTER INDEX ALL with REBUILD. This post checks fragmentation first, rebuilds a demo table and shows what the command does to a disabled index. It also compares REBUILD with REORGANIZE and the options that matter.
Query for CPU Pressure: Sample the Scheduler Queue
To sample the scheduler queue, read the runnable counts of every scheduler eight times, one second apart, and compare the result with a baseline. This post shows the queue on a quiet server and again while more busy sessions than schedulers run. It reads the spread, the streak and the average that tell pressure from noise.
Canceled Query Plan: Three Ways to Capture It in SQL Server
A canceled query plan can be captured with Live Query Statistics, with a live plan query while the statement runs, or from Query Store after the cancel. This post runs a long query, reads its plan while it runs, cancels it and then reads the aborted run from Query Store. It also explains which plan each method returns.
Batch Requests and Compilations per Second From T-SQL
Calculate compilations per second from cumulative SQL Server counters, compare batch rates, and investigate single-use plans with context.
Reading Deadlock Graphs From the system_health Session
Read deadlock graphs from system_health, identify victims and resource owners, reproduce a two-session cycle, and choose a targeted fix.
Stale Statistics: Detecting and Updating Them
Detect stale statistics with update properties, review modification thresholds, and schedule targeted refreshes with recorded outcomes.
Scheduler ID Values in dm_os_schedulers: What the Big Numbers Mean
Scheduler ID values in dm_os_schedulers run from 0 up to a few thousand, and then jump past one million. This post groups the rows into user, dedicated admin connection and hidden schedulers, and shows the filter that keeps CPU scripts honest. It also shows why filtering on the number alone is fragile.







