Easy learning with example program codes

explain different types of index in sql server

An index represents a schema object that contains an entry for each value that appears in the indexed column(s) of the table or cluster and provides direct, fast access to rows.


CREATE INDEX index_name
ON table_name (column_name)

Types of index

  • Unique: Guarantees unique values for the column(or set of columns) included in the index
  • Covering: Includes all of the columns that are used in a particular query (or set of queries), allowing the database to use only the index and not actually have to look at the table data to retrieve the results
  • Clustered: This is way in which the actual data is ordered on the disk, which means if a query uses the clustered index for looking up the values, it does not have to take the additional step of looking up the actual table row for any data not included in the index.

Related topics

Please follow and like us:
Posted in SQL   

Copyright © 2020 CodesJava Protection Status