Code Wrench
Apr 12, 2026 · Databases
How to Safely Build a Primary Key Index on a 10‑Billion‑Row Table
When a table exceeds a billion rows, creating a primary key clustered index can turn a routine operation into a disaster, but by using OFFLINE mode, MAXDOP, SORT_IN_TEMPDB, proper tempdb sizing, and a detailed runbook, you can safely rebuild the table with minimal impact.
Large TablesOffline IndexSQL Server
0 likes · 7 min read
