sorted_data Option

The sorted_data option of create index speeds index creation when the data in the table is already in sorted order, for example, when you have used bcp to copy sorted data into an empty table.

The speed increase becomes significant on large tables and increases to several times faster in tables larger than 1GB.

If you specify sorted_data, but data is not in sorted order, an error message appears and the command is aborted.

sorted_data speeds indexing only for clustered indexes or unique nonclustered indexes. Creating a nonunique nonclustered index is, however, successful, unless there are rows with duplicate keys. If there are rows with duplicate keys, an error message appears and the command is aborted.

Certain other create index options require a sort even if sorted_data is specified. See the Reference Manual: Commands.