v.20.3New Feature
Switch to MergeJoin if necessary
Switch from HashJoin to MergeJoin (on disk) if needed #9082 (Artem Zuikov)
Why it matters
This feature improves query reliability and resource management by enabling ClickHouse to switch to theMergeJoin algorithm on disk when the HashJoin cannot be used effectively, such as with large datasets that do not fit into memory. It ensures joins can still be performed without failure or excessive memory usage.How to use it
The switch fromHashJoin to MergeJoin occurs automatically when required. Users do not need to perform any manual configuration to enable this behavior; it is integrated into the query execution engine to handle large joins more efficiently.