Sunday, October 26, 2014

When to Use a Heap

If a table is a heap and does not have any nonclustered indexes, then the entire table must be examined (a table scan) to find any row. This can be acceptable when the table is tiny, such as a list of the 12 regional offices of a company.

When a table is stored as a heap, individual rows are identified by reference to a row identifier (RID) consisting of the file number, data page number, and slot on the page.
The row id is a small and efficient structure. Sometimes data architects use heaps when data is always accessed through nonclustered indexes

the RID is smaller than a clustered index key.

No comments:

Post a Comment