question

Raj More avatar image
Raj More asked

Sorting in TempDB

What is the significance of `SORT_IN_TEMPDB` when working with indexes on a table of significant size (20GB plus)?
sql-server-2008-r2indexsort_in_tempdb
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
SirSQL avatar image
SirSQL answered
When building/rebuilding the intermediate sorting of your index will take place in TempDB rather than on the database itself (unless the sort can be performed in memory). This means that TempDB needs to be large enough to accommodate that sort. If TempDB is on different disks this can provide a performance boost. For a more detailed explanation visit [ http://msdn.microsoft.com/en-us/library/ms188281.aspx][1] [1]: http://msdn.microsoft.com/en-us/library/ms188281.aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.