Table size = 44GB (no clustered index)
Row Count = 122016576
Disk space allocated to tempdb = 200MB
I wanted to create a clustered index for the table due to slow query times so I ran the following query:
USE [myDatabase] GO CREATE CLUSTERED INDEX [IX_Name] ON [dbo].[myTable] ( [myColumn] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = ON, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) GO
After 50 minutes of executing, my server's tempdb files (4 total) ran out of space and the database was sent into "In Recovery" status for about 10 minutes. It's up and running now but I'm confused as to why tempdb was utilized so much when I specifically said SORT_IN_TEMPDB = OFF.
Does anyone know why this operation utilized so much tempdb space?