Skip to content
Opensource internals
  • Posts

Posts

All posts published on this site.

Everything published here, newest first.

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 →

ClickHouse's SLRU Cache Promotes an Entry on Its Second Touch: A Scan Can't Flush It

Oct 19, 2026 20 min read Jay Hubbert

ClickHouse’s default cache policy is SLRU, not LRU: entries hit twice are promoted to a protected queue that a sequential scan cannot flush.

ClickhouseInternalsCachingPerformanceAlgorithms

Read more →

ClickHouse Short-Circuits AND and OR: A Thunk and a UInt8 Mask of Undecided Rows

Oct 19, 2026 21 min read Jay Hubbert

ClickHouse defers heavy and/or/if arguments into a thunk and runs them only on the rows a UInt8 mask leaves undecided.

ClickhouseInternalsPerformanceShort circuit

Read more →

ClickHouse Runs 47 Rewrite Passes Before Planning: count(*) Becomes a Metadata Read

Oct 19, 2026 19 min read Jay Hubbert

ClickHouse inlines aliases, runs 47 ordered tree passes, prunes columns and rewrites count(*) into a metadata read before planning.

ClickhouseInternalsQuery planOptimization

Read more →

← Newer Page 61 of 86 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·