Indexes

THIS TOPIC APPLIES TO: yesSQL Server (starting with 2016)yesAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

The following table lists the types of indexes available in SQL Server and provides links to additional information.

Index type Description Additional information
Hash With a hash index, data is accessed through an in-memory hash table. Hash indexes consume a fixed amount of memory, which is a function of the bucket count. Guidelines for Using Indexes on Memory-Optimized Tables
memory-optimized nonclustered indexes For memory-optimized nonclustered indexes, memory consumption is a function of the row count and the size of the index key columns Guidelines for Using Indexes on Memory-Optimized Tables
Clustered A clustered index sorts and stores the data rows of the table or view in order based on the clustered index key. The clustered index is implemented as a B-tree index structure that supports fast retrieval of the rows, based on their clustered index key values. Clustered and Nonclustered Indexes Described

Create Clustered Indexes
Nonclustered A nonclustered index can be defined on a table or view with a clustered index or on a heap. Each index row in the nonclustered index contains the nonclustered key value and a row locator. This locator points to the data row in the clustered index or heap having the key value. The rows in the index are stored in the order of the index key values, but the data rows are not guaranteed to be in any particular order unless a clustered index is created on the table. Clustered and Nonclustered Indexes Described

Create Nonclustered Indexes
Unique A unique index ensures that the index key contains no duplicate values and therefore every row in the table or view is in some way unique.

Uniqueness can be a property of both clustered and nonclustered indexes.
Create Unique Indexes
Columnstore An in-memory columnstore index stores and manages data by using column-based data storage and column-based query processing.

Columnstore indexes work well for data warehousing workloads that primarily perform bulk loads and read-only queries. Use the columnstore index to achieve up to 10x query performance gains over traditional row-oriented storage, and up to 7x data compression over the uncompressed data size.
Columnstore Indexes Guide

Using Nonclustered Columnstore Indexes
Index with included columns A nonclustered index that is extended to include nonkey columns in addition to the key columns. Create Indexes with Included Columns
Index on computed columns An index on a column that is derived from the value of one or more other columns, or certain deterministic inputs. Indexes on Computed Columns
Filtered An optimized nonclustered index, especially suited to cover queries that select from a well-defined subset of data. It uses a filter predicate to index a portion of rows in the table. A well-designed filtered index can improve query performance, reduce index maintenance costs, and reduce index storage costs compared with full-table indexes. Create Filtered Indexes
Spatial A spatial index provides the ability to perform certain operations more efficiently on spatial objects (spatial data) in a column of the geometry data type. The spatial index reduces the number of objects on which relatively costly spatial operations need to be applied. Spatial Indexes Overview
XML A shredded, and persisted, representation of the XML binary large objects (BLOBs) in the xml data type column. XML Indexes (SQL Server)
Full-text A special type of token-based functional index that is built and maintained by the Microsoft Full-Text Engine for SQL Server. It provides efficient support for sophisticated word searches in character string data. Populate Full-Text Indexes

SORT_IN_TEMPDB Option For Indexes

Disable Indexes and Constraints

Enable Indexes and Constraints

Rename Indexes

Set Index Options

Disk Space Requirements for Index DDL Operations

Reorganize and Rebuild Indexes

Specify Fill Factor for an Index

Pages and Extents Architecture Guide

See Also

Clustered and Nonclustered Indexes Described