Skip to content
Opensource internals
  • Posts

Posts

All posts published on this site.

Everything published here, newest first.

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 →

ClickHouse Flattens an Expression DAG into Fixed Slots: Replayed Once Per 65 409-Row Block

Oct 19, 2026 16 min read Jay Hubbert

ClickHouse compiles a SELECT into an ActionsDAG and reuses the sorted plan for every block.

ClickhouseInternalsQuery planPerformance

Read more →

ClickHouse Reads MergeTree Parts in Key Order: Constant Key Columns Count Toward the Prefix

Oct 19, 2026 16 min read Jay Hubbert

ClickHouse matches ORDER BY against the sorting key and reads MergeTree parts in key order instead of sorting everything.

ClickhouseInternalsQuery planPerformance

Read more →

← Newer Page 59 of 83 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·