Skip to content

extract or clause as predicate for join rels #3577

Closed
@HuSen8891

Description

@HuSen8891

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

examine OR clause for join to see if any useful clauses can be extracted and push down.
the new clause as join rel's predicate will filter more rows before join.

for such query:
select * from test, test1 where (test.a = test1.c and test.b > 1) or (test.b = test1.d and test.c < 10);

current logical plan:
Filter: (a = c and b > 1) or (b = d and c < 10)
crossjoin:
TableScan: projection=[a, b, c]
TableScan: projection=[c, d]

optimized to

Filter: (a = c and b > 1) or (b = d and c < 10)
crossjoin:
Filter: (b > 1) or (c < 10)
TableScan: projection=[a, b, c]
TableScan: projection=[c, d]

Describe the solution you'd like
Above

Describe alternatives you've considered
None

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions