Sql-server – Rebuilding Index – sort in temp db

indexsql serversql-server-2008-r2

What is the significance of SORT_IN_TEMPDB when working with indexes on a table of significant size (20GB plus)?

Where else does sorting take place?

Best Answer

It depends.

The options are -

  • Sort in the destination file group (normally PRIMARY on the DB the index is on)
  • Sort in TempDB

If your TempDB is on a different disk array and not active, you could see a performance increase. There are also space considerations.

There's a pretty good article on MSDN about this topic here.