Skip to content

Commit 717e55c

Browse files
authored
Merge pull request #967 from jpomfret/sortintempdb
Formatting on SORT_IN_TEMPDB option for indexes
2 parents 3a427b6 + eb8b042 commit 717e55c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docs/relational-databases/indexes/sort-in-tempdb-option-for-indexes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,19 @@ monikerRange: "=azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversio
5454

5555
If SORT_IN_TEMPDB is set to OFF, the available free disk space in the destination filegroup must be roughly the size of the final index. During the first phase, the sort runs are built and require about the same amount of space as the final index. During the second phase, each sort run extent is freed after it has been processed. This means that sort run extents are freed at about the same rate at which extents are acquired to hold the final index pages; therefore, the overall space requirements do not greatly exceed the size of the final index. One side effect of this is that if the amount of free space is very close to the size of the final index, the [!INCLUDE[ssDE](../../includes/ssde-md.md)] will generally reuse the sort run extents very quickly after they are freed. Because the sort run extents are freed in a somewhat random manner, this reduces the continuity of the index extents in this scenario. If SORT_IN_TEMPDB is set to OFF, the continuity of the index extents is improved if there is sufficient free space available in the destination filegroup that the index extents can be allocated from a contiguous pool instead of from the freshly deallocated sort run extents.
5656

57-
When you create a nonclustered index, you must have available as free space:
57+
When you create a nonclustered index, you must have available as free space:
5858

5959
- If SORT_IN_TEMPDB is set to ON, there must be sufficient free space in **tempdb** to store the sort runs, and sufficient free space in the destination filegroup to store the final index structure. The sort runs contain the leaf rows of the index.
6060

6161
- If SORT_IN_TEMPDB is set to OFF, the free space in the destination filegroup must be large enough to store the final index structure. The continuity of the index extends may be improved if more free space is available.
6262

63-
When you create a clustered index on a table that does not have nonclustered indexes, you must have available as free space:
63+
When you create a clustered index on a table that does not have nonclustered indexes, you must have available as free space:
6464

6565
- If SORT_IN_TEMPDB is set to ON, there must be sufficient free space in **tempdb** to store the sort runs. These include the data rows of the table. There must be sufficient free space in the destination filegroup to store the final index structure. This includes the data rows of the table and the index B-tree. You may have to adjust the estimate for factors such as having a large key size or a fill factor with a low value.
6666

6767
- If SORT_IN_TEMPDB is set to OFF, the free space in the destination filegroup must be large enough to store the final table. This includes the index structure. The continuity of the table and index extents may be improved if more free space is available.
6868

69-
When you create a clustered index on a table that has nonclustered indexes, you must have available as free space:
69+
When you create a clustered index on a table that has nonclustered indexes, you must have available as free space:
7070

7171
- If SORT_IN_TEMPDB is set to ON, there must be sufficient free space in **tempdb** to store the collection of sort runs for the largest index, typically the clustered index, and sufficient free space in the destination filegroup to store the final structures of all the indexes. This includes the clustered index that contains the data rows of the table.
7272

0 commit comments

Comments
 (0)