Skip to content
Opensource internals
  • Posts

Distinct

How ClickHouse Runs UNION, INTERSECT and EXCEPT

Oct 22, 2026 14 min read Jay Hubbert

UNION ALL merges streams, UNION DISTINCT adds a hash DISTINCT with a self-abandoning preliminary pass, and INTERSECT/EXCEPT filter the left side through a set of the right.

ClickhousePerformanceInternalsSet operationsDistinct

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·