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

Optimize TupleDomainFilter for NOT IN #13843

Open
mbasmanova opened this issue Dec 11, 2019 · 3 comments
Open

Optimize TupleDomainFilter for NOT IN #13843

mbasmanova opened this issue Dec 11, 2019 · 3 comments
Assignees

Comments

@mbasmanova
Copy link
Contributor

@mbasmanova mbasmanova commented Dec 11, 2019

TupleDomainFilters for IN predicates are optimized to use hash tables for lookups and offer O(1) performance, but NOT IN filters are not optimized and give O(n) performance. Yet, there is no reason why IN predicate optimization couldn't apply to NOT IN. We could extend BytesValues and BigintValues to add a flag indicating that this is a NOT filter and add logic to com.facebook.presto.orc.TupleDomainFilterUtils#toFilter to set this flag.

See com.facebook.presto.orc.TupleDomainFilter.BytesValues and com.facebook.presto.orc.TupleDomainFilter.BigintValues#BigintValues

CC: @prestodb/aria

@kewang1024
Copy link
Contributor

@kewang1024 kewang1024 commented Dec 24, 2019

Do we want to create new class that extends BytesValues/BigintValues or we just add the flag to BytesValues/BigintValues class @mbasmanova @bhhari

@kewang1024
Copy link
Contributor

@kewang1024 kewang1024 commented Dec 24, 2019

Also for BigintValues, now we have BigintValuesUsingHashTable and BigintValuesUsingBitmask, do we only extend the function to BigintValuesUsingHashTable? @mbasmanova @bhhari

@mbasmanova
Copy link
Contributor Author

@mbasmanova mbasmanova commented Jan 2, 2020

@kewang1024 Ke, I'd start by adding a flag to BytesValues and BigintValuesXxx classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.