cockroachdb / pebble

RocksDB/LevelDB inspired key-value database in Go
BSD 3-Clause "New" or "Revised" License
4.6k stars 424 forks source link

colblk: add Bitmap, BitmapBuilder #3711

Open jbowens opened 3 days ago

jbowens commented 3 days ago

Introduce the sstable/colblk package for columnar block primitives, and add a first primitive for storing bitmaps.

The Bitmap uses 1+1/64 physical bits per logical bit. Bits are organized into 64-bit words, allowing constant-time access of an individual bit. Additionally, after the bitmap a summary bitmap consisting of 1 bit per 64-bit word of the bitmap provides faster lookup of preceding or successive set bits. This will be used by a bitmap indicating when a key prefix changes to quickly find the next key within a block with a new prefix.

cockroach-teamcity commented 3 days ago

This change is Reviewable