Skip to content
Opensource internals
  • Posts

Query plan

ClickHouse Builds an Actions DAG Once and Runs It on Every Block

Oct 23, 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 Pushes ORDER BY into the Storage Read

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

ClickHouse Rewrites the Query Before It Plans It

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

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·