Database Reference
In-Depth Information
Clustered: This type of index sorts the data in a table according to the key specified in the
index. It is advisable to use a clustered index on your tables and to keep that index as small
as possible. Single column integers work best for these types of indexes. You can only have
one clustered index in a table.
Nonclustered: This type of index builds a pointer to the clustered index of the table if one
exists. You can have multiple nonclustered indexes in a table, and you should build these for
columns that are used in query joins and search criteria.
Unique: A unique index is a constraint that you can place on a column or a group of columns
to force SQL Server to allow only unique values or combinations of values in that index.
You should assess the queries in your system and add necessary indexes on your table to optimize
performance.
Creating an index
To create an index, follow these steps:
1. Expand the table you're adding the index to in SQL Server Management Studio. Right-click
the Indexes folder and choose New Index.
A New Index window opens, as shown in Figure 10-10.
Figure 10-10: Adding a new index.
 
Search WWH ::




Custom Search