Skip to content
Opensource internals
  • Posts

Posts

All posts published on this site.

Everything published here, newest first.

ClickHouse Splits PREWHERE into Read Steps: Bytes per Rejected Row Picks the Order

Oct 19, 2026 17 min read Jay Hubbert

ClickHouse moves WHERE conditions into PREWHERE by cost per rejected row, and reads PREWHERE columns in separate read steps.

ClickhouseMergetreePrewhereQuery planningPerformance

Read more →

ClickHouse Flattens the Join Tree into a QueryGraph: A Greedy Search and a Full Plan Rebuild

Oct 19, 2026 15 min read Jay Hubbert

ClickHouse flattens the join tree into a graph, searches it for a cheaper order, and rebuilds the plan.

ClickhouseQuery planningJoinsOptimizerInternals

Read more →

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 →

← Newer Page 60 of 86 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·