index

Index (in computer science) is a database object in relational databases that enables efficient and rapid access to data in the rows of a database table using key values.

What is Index (in computer science)?

A database object in relational databases that enables efficient and rapid access to data in the rows of a database table using key values.

Indexes are created on columns in a Microsoft SQL Server database and provide a way to logically order rows in a database table. Because databases without indexes take much longer to query, planning and implementing indexes is an essential part of database design.

Indexes can also be used to enforce the uniqueness of rows in a database table by building the index on a key value.

TIP

Although using indexes generally speeds queries, it is not a good idea to have an index for every column because building the index takes time and requires additional disk space, plus modifying the contents of the database causes modifications to the index. You should only create indexes for the following:

  • Primary and foreign keys
  • Data on which you frequently issue search queries
  • Columns that are often retrieved in a sorted order or are used in joins