Unanswered: sqlserver non clustered index row locator
got a question when reading below about the row locator in the leaves of non clustered index in sql server:
question is: why not use row id (rid) as row locator even for the second case below (ie. table with a clustered index)? would not that locate the data row directly? instead of searching start from the clustered index key.
The row locators in nonclustered index rows are either a pointer to a row or are a clustered index key for a row, as described in the following:
If the table is a heap, which means it does not have a clustered index, the row locator is a pointer to the row. The pointer is built from the file identifier (ID), page number, and number of the row on the page. The whole pointer is known as a Row ID (RID).
If the table has a clustered index, or the index is on an indexed view, the row locator is the clustered index key for the row. If the clustered index is not a unique index, SQL Server makes any duplicate keys unique by adding an internally generated value called a uniqueifier. This four-byte value is not visible to users. It is only added when required to make the clustered key unique for use in nonclustered indexes. SQL Server retrieves the data row by searching the clustered index using the clustered index key stored in the leaf row of the nonclustered index.
Thanks for any shed lights or straight forward materials.