How does Non-Clustered index work when it has a lot of keys with the same value

80 Views Asked by At

Suppose that I have a heap table with columns (id, name, gender, age)

If I have a NonClustered index in a column "name", what happens if I have like 10 people named "Lucas"? Does the index know which one "Lucas" he is point to? If there are so many Lucas' that they are separated in different pages on the B-Tree leafs, does the index still knowing how to find them and which row he has to point for every "Lucas"?

1

There are 1 best solutions below

0
On

•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).

http://technet.microsoft.com/en-us/library/ms177484(v=sql.105).aspx