Class ExpandDisjunctionForJoinInputsRule

All Implemented Interfaces:
TransformationRule

@Enclosing public class ExpandDisjunctionForJoinInputsRule extends RelRule<ExpandDisjunctionForJoinInputsRule.Config> implements TransformationRule
Rule to expand disjunction for join inputs in condition of a Filter or Join. For example:

 select t1.id from t1, t2, t3
 where t1.id = t2.id
 and t1.id = t3.id
 and (
     (t1.age < 50 and t3.age > 20)
     or
     (t2.weight > 70 and t3.height < 180)
 )
 

we can expand to obtain the condition


 select t1.id from t1, t2, t3
 where t1.id = t2.id
 and t1.id = t3.id
 and (
     (t1.age < 50 and t3.age > 20)
     or
     (t2.weight > 70 and t3.height < 180)
 )
 and (t1.age < 50 or t2.weight > 70)
 and (t3.age > 20 or t3.height < 180)
 

new generated predicates are redundant, but they could be pushed down to join inputs([t1, t2], [t3]) and reduce the cardinality.

Note: This rule is similar to the ExpandDisjunctionForTableRule, but this rule divides the predicates by Join inputs.

See Also: