Using SORT_IN_TEMPDB to improve Index Performance

The SORT_IN_TEMPDB option directs the index creation processing to the tempdb database, instead of the database in use.

This option may increase rebuild performance for large tables on a high activity environment, if the tempdb system database is located on a separate disk. Although the index creation time may decrease, the disk space requirements increase while using this option.

Note: Make sure a dedicated disk is allotted to the tempdb database and it has sufficient disk space. When using the SORT_IN_TEMPDB option, DBA’s usually calculate the disk space requirement while doing capacity planning.

By default SORT_IN_TEMPDB is OFF. You can enable this option as shown below:

CREATE NONCLUSTERED INDEX AddIndexNmHere ON
DBNm.TableNm (ColumnName)
WITH (SORT_IN_TEMPDB = ON)

No comments:

Post a Comment