Skip to content
Opensource internals
  • Posts

Posts

All posts published on this site.

Everything published here, newest first.

ClickHouse Guesses Join Sizes from Distinct-Value Counts: One Over the Larger NDV

Oct 19, 2026 16 min read Jay Hubbert

ClickHouse’s join cost model is built from NDV counts, min/max ranges and row estimates.

ClickhouseQuery planningStatisticsCardinalityOptimizer

Read more →

ClickHouse Searches Join Orders with Dynamic Programming: Three Algorithms Over One Memo Keyed by Bitsets

Oct 19, 2026 15 min read Jay Hubbert

ClickHouse ships three DP join-order searches over a relation-set memo, with a plan budget and a fallback chain.

ClickhouseQuery planningJoinsDynamic programmingOptimizer

Read more →

ClickHouse Reads a 5-Bit Rank Through an Unaligned 16-Bit Window: The CompactArray Trick

Oct 19, 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 →

ClickHouse's ArenaWithFreeLists Recycles by Size Class: 14 Lists From 8 to 65536 Bytes

Oct 19, 2026 18 min read Jay Hubbert

ClickHouse’s ArenaWithFreeLists keeps one free list per power-of-two size class and threads the free-list link through the freed block itself.

ClickhouseInternalsMemoryPerformanceData structures

Read more →

ClickHouse's LRU Cache Evicts by Bytes, Not Entries: A Hit Is One List Splice

Oct 19, 2026 20 min read Jay Hubbert

ClickHouse’s LRU cache is a hash map of cells pointing into a linked list, so a lookup is an O(1) splice and eviction is a pop from the front.

ClickhouseInternalsCachingPerformanceData structures

Read more →

← Newer Page 58 of 83 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·