Class BitmapValueIndexMaintainer


  • @API(EXPERIMENTAL)
    public class BitmapValueIndexMaintainer
    extends StandardIndexMaintainer
    An index maintainer for storing bitmaps of which records meet a specific condition.

    The index is defined on a position field, grouped by zero or more value conditions. The position should be an integer that is unique and reasonably dense, since compression of the index is traded off in favor of simplicity and concurrent updates. If the position is not set, then the item is not indexed at all.

    Instead of one key per record, the index stores one bit per record in a fixed-size bitmap aligned on even multiples of the position key. Empty (that is, all zero) bitmaps are not stored.

    The position bitmaps behave as aggregate functions, additionally restricted by ranges of the position, as though position (or its modulus) were another grouping column. It is possible to roll-up the stored bitmaps into a single, bigger, bitmap. But because these are rather large, it is generally preferable to scan the index and deal with the bitmaps in order as stored. If the position endpoints are not aligned to the bitmap quantum, the first and last bitmaps will be suitably trimmed.

    A unique option means that the index checks uniqueness of the position, with the expense of an additional read at update time. Also, when a uniqueness violation does occur, it is not possible to know what other record caused it. A separate unique index on the position field, if it is not the primary key, is therefore generally preferable.