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

Implement like range index filtering #303

Open
wants to merge 3 commits into
base: master
from

Conversation

@sixcorners
Copy link
Contributor

@sixcorners sixcorners commented Sep 3, 2020

Hey! Have some more untested code!
This lets the range filter be used with the like operator.
Is ~~ the right thing to test the operator against? I don't really see a list of these things anywhere.
I still need to test this and write some automated tests for it.
I'm not exactly confident that the logic is all there.
I've also never really written anything in python.
Could I get a code review?

sixcorners added 3 commits Sep 3, 2020
@sixcorners
Copy link
Contributor Author

@sixcorners sixcorners commented Sep 3, 2020

The way it's implemented here isn't super straightforward.. I felt like I had to logic my way through what happens when the range of the scan is located at different points compared to the range of the index. Ideally it would be as easy as described in the first comment here: https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/like_support.c but I didn't want to deal with collation issues.
Since we are locked to the C collation I guess I could have made a python method to do something like make_greater_string in that like_support.c file.
I don't know.

@sixcorners
Copy link
Contributor Author

@sixcorners sixcorners commented Sep 3, 2020

Oh ya.. I guess I could also pull out that re.compile call into a constant.

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

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.