Using Covering Indexes
As mentioned earlier, when you insert or update a record, any data in a column that is included in
an index is stored not only in the table, but also in the indexes for nonclustered indexes. From finding
an entry in an index, SSE then moves to the table to locate and retrieve the record. However, if
the necessary information is held within the index, there is no need to go to the table and retrieve
the record, providing much speedier data access.
For example, consider the ShareDetails.Shares table in the ApressFinancial database. Suppose
that you wanted to find out the description, current price, and ticker ID of a share. If an index
was placed on the ShareId column, knowing that this is an identifier column and therefore unique,
you would ask SSE to find a record using the ID supplied. It would then take the details from the
index of where the data is located and move to that data area. If, however, there was an index with
all of the columns defined, SSE will be able to retrieve the description ticker and price details in the
index action. It will not be necessary to move to the data area. This is called a covered index, since
the index covers every column in the table for data retrieval.
什么是“Using Covering Indexes”
最新推荐文章于 2022-02-09 03:56:28 发布