ClickHouse Builds an Actions DAG Once and Runs It on Every Block
ClickHouse compiles a SELECT into an ActionsDAG and reuses the sorted plan for every block.
ClickHouse compiles a SELECT into an ActionsDAG and reuses the sorted plan for every block.
ClickHouse matches ORDER BY against the sorting key and reads MergeTree parts in key order instead of sorting everything.
ClickHouse inlines aliases, runs 47 ordered tree passes, prunes columns and rewrites count(*) into a metadata read before planning.