Ref collection indexes

October 27th, 2004 at 1:06 pm (3 years, 8 months ago) by Andi Vajda under chandlerdb

As said in an earlier post, ref collections are implemented as a double-linked list of bi-directional item references. Ref collection indexes enhance ref collections by enabling positional access into them.

To be scalable, a ref collection index is implemented with a skip list, a probabilistic alternative to balanced trees developed by William Pugh.

A ref collection index maintains and persists an item reference order separately from the ref collection’s intrinsic order. A ref collection may have several, independently ordered, indexes. The simplest index, NumericIndex, just provides numeric access into a ref collection. Other indexes, such as the AttributeIndex, maintain a sorted order by watching an attribute’s value changes.

Because indexes are very much tied to their owning ref collection, the APIs for manipulating indexes are all defined on the RefList class. For example, to add an index onto a ref collection, use the addIndex API.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Reddit

Leave a Reply