Skip to content
Opensource internals
  • Posts

Optimizer

ClickHouse Estimates Join Cardinality from Distinct-Value Counts

Oct 24, 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 Reorders Joins by Turning the Join Tree into a Graph

Oct 24, 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 Searches Join Orders with Dynamic Programming

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

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·