Skip to content
Opensource internals
  • Posts

Bit tricks

ClickHouse Packs a HyperLogLog Rank Into Five Bits

Oct 23, 2026 19 min read Jay Hubbert

ClickHouse’s CompactArray stores sub-byte values in a bitset and reads them through an unaligned 16-bit window, so a HyperLogLog rank costs 5 or 6 bits per bucket.

ClickhouseInternalsPerformanceBit tricksMemory

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·