Under block-aware encoding, a bitmap represented by atoms comprises a
series of bitmaps for each data block in a database. Each bitmap in the
series is referred to herein as a block bitmap. Each block bitmap may
have a different number of bytes or bits. Gaps are represented in atoms
using a pair of numbers referred to as a gap code. A gap code includes a
block-skip code and slot-skip code. A block-skip code represents how many
block bitmaps to advance to reach a subsequent block bitmap; a slot-skip
code represents how many bytes to advance within the block bitmap to
reach a byte with at least one bit set. A gap code is represented by bit
positions within a byte, with some bit positions allocated to represent
the block-skip code and some to represent the slot-skip code. The
allocation is adjusted dynamically during encoding and decoding.