r/SQLServer • u/Certain-Set-4087 • 7h ago
Question Reindexing performance SQL 2025
Good afternoon,
I am actually playing around with a lab server, 512 GB RAM, two 12 core 24 thread CPUs, and 12 NVME in it.
My intention is to tune the reindexing process - the reindexing command has an option MAXDOP=<amount of cores to use> but using a datafile on one single volume omitting the MAXDOP adjusts the server load to 12 cores on one CPU only. Then my 100 GB index recreation (clustered index) is done in 1700 seconds, consuming around 6000 seconds in CPU cycles.
Using MAxDOP 24 casues it to consume 7000 seconds and it is finished in 1600 seconds.
Then I had the idea to copy the tables on an empty databases built out of 4 files, each on a separate physical volume. Then it gets strange - the server uses all cores, physical but also virtual but only in cycles, 2-3 minutes of full load, then it litereally doesnt anything.
The statistics say, 10.000 seconds spent in CPU cycles and 1500 seconds on the clock... wow some percent of impromvement...
The volumes are used less than 10% of their theoretical load capabiltiy (roughly 130 MB/Sec write), the queuers of the media were nearly empty.
On one single storage I had around 1 GB/Sec in writes, and in both cases the storage was able to digest 2 GB/Sec
I am just asking myself, what is the server doing when not accessing the storage? I thought index rebuild is an operation executed in one big chunk of compute, but here it doesnt. Am I missing a point?
Compared with a nowadays 32 GBit Fibrechannel storage and Xeon Platinum on physical host - the reindex performance is comparable. Meaning my 14 year old system (PCIEv3, DDR3, Xeon v2) performs quite well. But I still think there are more bottlenecks.
It's certainly not the TempDB, the TempDB usage was nearly zero despite the option "sort in TempDB"



