Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract or clause as predicate for join rels #3577

Closed
HuSen8891 opened this issue Sep 21, 2022 · 0 comments · Fixed by #3578
Closed

extract or clause as predicate for join rels #3577

HuSen8891 opened this issue Sep 21, 2022 · 0 comments · Fixed by #3578
Labels
enhancement New feature or request

Comments

@HuSen8891
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant