Using Integrated Indexes

To fetch base table rows using two separate rowsets, one over the base table and another over the index, the consumer:

  1. Calls IRowsetIndex::SetRange on the index rowset to set the range.

  2. (Optional) Calls IRowsetIndex::Seek on the index rowset to seek a particular index value. This sets the next fetch position on the index rowset to the first row in the index rowset that matches the specified value.

  3. Calls IRowset::GetNextRows on the index rowset to fetch the index entry.

  4. Extracts a bookmark from the index row that points to the corresponding row in the base table rowset.

  5. Calls IRowsetLocate::GetRowsAt on the base table rowset with the extracted bookmark to get the base table row.

To fetch base table rows using an integrated index, the consumer:

  1. Calls IRowsetIndex::SetRange on the base table rowset to set the range.

  2. (Optional) Calls IRowsetIndex::Seek on the base table rowset to seek a particular index value. This sets the next fetch position on the base table rowset to the first row in the index that matches the specified value.

  3. Calls IRowset::GetNextRows on the base table rowset to fetch the base table row.

When using an integrated index rowset, there are three important differences from using separate index and base table rowsets: