Speeding up Index rebuild

Oopps! Upgrade your browser pretty please. Oopps! Upgrade your browser pretty please.

I am pretty sure that we all agree by now that rebuilding your indexes regurlarly are an important part of keeping your SQL Server running fast and smooth 🙂 And in most cases, we could agree that “Max Degree Of Parallellism” should be set to something else than Zero. But rebuilding indexes are a type of operation that would in many cases benefit greatly from using all CPU’s. So what to do? You COULD do the following:

Insert this code in the beginning of your Index rebuild Script:

sp_configure “Max Degree Of Parallellism”, 0

go

reconfigure with override

go

<REBUILD Index Code…..>

And then add the following snippet after you are finished

sp_configure “Max Degree Of Parallellism”, X<—— X = whatever you usually run on here.

go

reconfigure with override

go