Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Feb 13 '12 at 22:08

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

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.

share|improve this answer

What it does is instead of utilizing the target database to do the intermediate sorts for creating and rebuilding the index, it uses tempdb for this task. You will most likely see performance gains as far as duration of the time it would normally take, but it will also increase the amount of disk space used.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.