This repository has been archived by the owner on Jan 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 109
sql/(plan,analyzer): implement pushdown of filters and cols #86
Merged
erizocosmico
merged 2 commits into
src-d:master
from
erizocosmico:feature/pushdown-filters
Mar 12, 2018
Merged
sql/(plan,analyzer): implement pushdown of filters and cols #86
erizocosmico
merged 2 commits into
src-d:master
from
erizocosmico:feature/pushdown-filters
Mar 12, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
erizocosmico
force-pushed
the
feature/pushdown-filters
branch
from
March 7, 2018 14:17
8feef5d
to
4343213
Compare
erizocosmico
changed the title
sql/(plan,analyzer): implement table pushdown
sql/(plan,analyzer): implement pushdown of filters and cols
Mar 7, 2018
jfontan
reviewed
Mar 7, 2018
}) | ||
|
||
if len(tables) == 1 { | ||
filtersByTable[tables[0]] = append(filtersByTable[tables[0]], expr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe I don't understand this logic. Does it mean that the expression is only added to the left table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A filter is only pushed down if only one table is mentioned in the expression (unless we want to change that behavior)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
erizocosmico
force-pushed
the
feature/pushdown-filters
branch
from
March 8, 2018 13:49
4343213
to
6d6ca8c
Compare
Updated to receive sessions |
erizocosmico
force-pushed
the
feature/pushdown-filters
branch
from
March 9, 2018 14:54
8776ea5
to
c53887a
Compare
ajnavarro
approved these changes
Mar 12, 2018
mcarmonaa
approved these changes
Mar 12, 2018
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
erizocosmico
force-pushed
the
feature/pushdown-filters
branch
from
March 12, 2018 10:31
c53887a
to
a923e50
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #82
Closes #27
Closes #28
Supersedes #83
Implementation details
Only columns and filters that apply to a column are pushed down to that column. That is, if you have
42 > 5
that filter will not be pushed down to any table, and if you havea.foo = 5
that filter will only be pushed down to tablea
.If more than one table is mentioned in a filter, it's not pushed down to neither. E.g.
a.foo = b.foo
is not pushed down.Perhaps we want the opposite and we want all filters pushed down to the table, regardless of whether it mentions the table or not?
Also, join conditions are not being pushed down as filters, should we also push those down?