opt: Add pruning rule for columns on the right side of Semi/Anti joins #38704
Labels
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
E-starter
Might be suitable for a starter project for new employees or team members.
Milestone
Consider this schema and query:
The optimized query uses a semi-join:
However, the
d
column can be pruned here, since it is not used by the join, and is not returned as an output column.We should add a new
prune_cols.opt
rule that prunes unused columns on the right side of a Semi or Anti join (assuming the columns are in thePruneCols
rule property set).The text was updated successfully, but these errors were encountered: