Currently, foreign_join_ok() uses only JOIN key expressions in INNER JOIN and SEMI JOIN expressions: that is, only expressions that reference both the right and left keys using the equality operator. The rest are appended to remote conditions for use in the WHERE clause.
I suspect that ClickHouse used to allow only join key expressions but opened it up to additional expressions later. Today at least one must be a join key expression but other expressions are allowed.
Would it make sense to allow all expressions to be pushed down as JOIN expressions, rather than filtering some to remote conditions (the WHERE clause)? Seems like there might be some efficiencies in that, although maybe the ClickHouse optimizer adjusts appropriately to save cycles and iops?
Currently,
foreign_join_ok()uses only JOIN key expressions in INNER JOIN and SEMI JOIN expressions: that is, only expressions that reference both the right and left keys using the equality operator. The rest are appended to remote conditions for use in theWHEREclause.I suspect that ClickHouse used to allow only join key expressions but opened it up to additional expressions later. Today at least one must be a join key expression but other expressions are allowed.
Would it make sense to allow all expressions to be pushed down as JOIN expressions, rather than filtering some to remote conditions (the WHERE clause)? Seems like there might be some efficiencies in that, although maybe the ClickHouse optimizer adjusts appropriately to save cycles and iops?