-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
sql: propagate equalities to optimize JOIN filters further #12892
Comments
My suggestion was not around range analysis and such, but simply to allow It's not clear how to calculate the remaining filter (the part that can't be pushed down) with this method, but we can be less functional on that part (it's not a big deal if it's not as small as possible, as long as it disappears in common cases where it needs to disappear). |
Even equalities should be propagated. @bdarnell reports:
Also my manual optimizations on https://forum.cockroachlabs.com/t/select-query-not-responding/672/32 |
Is there a complexity here that I'm not seeing? Seems like there is a pretty big win on many queries from implementing this. |
Yes the complexity is that I still do not understand splitFilter() well enough that I would know where to implement this effectively. |
The logic would be in the |
The action is all in |
Yet I think I understand what Radu is saying :) |
Propagation for this case appears supported by both the heuristic optimizer and the cost-based optimizer. Closing as "Fixed". |
Pursuant to #12617, suggested by @RaduBerinde, relative to predicates over JOINs
This entails propagating the equalities to the inequalities, perform range analysis, and propagate the resulting ranges towards the JOIN operands.
The text was updated successfully, but these errors were encountered: