Back to Lance

Bitmap Index

docs/src/format/table/index/scalar/bitmap.md

4.0.11.4 KB
Original Source

Bitmap Index

Bitmap indices use bit arrays to represent the presence or absence of values, providing extremely fast query performance for low-cardinality columns.

Index Details

protobuf
%%% proto.message.BitmapIndexDetails %%%

Storage Layout

The bitmap index consists of a single file bitmap_page_lookup.lance that stores the mapping from values to their bitmaps.

File Schema

ColumnTypeNullableDescription
keys{DataType}trueThe unique value from the indexed column
bitmapsBinarytrueSerialized RowAddrTreeMap containing row addrs where this value appears

Accelerated Queries

Query TypeDescriptionOperation
Equalscolumn = valueReturns the bitmap for the specific value
Rangecolumn BETWEEN a AND bUnions all bitmaps for values in the range
IsIncolumn IN (v1, v2, ...)Unions bitmaps for all specified values
IsNullcolumn IS NULLReturns the pre-computed null bitmap