v.25.7Improvement

Improve CROSS JOIN

Improve CROSS JOIN by returning false from HashJoin::needUsedFlagsForPerRightTableRow. #82379 (lgbo).
Improve CROSS JOIN performance by optimizing the internal hash join logic to skip unnecessary flags for each right table row.

Why it matters

This feature enhances the efficiency of CROSS JOIN operations by modifying the HashJoin::needUsedFlagsForPerRightTableRow function to return false, thus avoiding the overhead of managing used flags for each row in the right table. This reduces computational complexity and improves query execution speed for CROSS JOINs.

How to use it

The improvement is applied internally within the ClickHouse engine and requires no explicit action from users. CROSS JOIN queries will automatically benefit from this optimization after upgrading to the version including this change.