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
Process IN constraints all at once in xFilter #8263
base: master
Are you sure you want to change the base?
Process IN constraints all at once in xFilter #8263
Conversation
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.
Do we think there are any table implementations that rely on this behavior? Any thoughts on a strategy to determine that? |
Feels unlikely. When I've brought this up previously, people thought (a) didn't work this way or (b) was inherent to the implementation and unfixable. |
Yeah definitely it wasn't possible to do before, they added The question here is if the The problem I see here is that if the tables do not account for this (multiple constraints values for the same constraint), then the result is wrong, because they will filter only with the first value, while with the old method, the table logic would've been called multiple times, each with one of the values in the If Here is a case, in the
Also I think due to this, none of the table logic inside the loop has been tested with a loop count > 1. So I suspect we will encounter bugs. |
We talked about this briefly at Office Hours today. @Smjert suggest that incorrect loops should be relatively to audit for -- we can examine tables that have |
Just to clarify, there are 2 potential issues:
For 1., the code will use |
Sorry that I've been silent on this thread, I've been testing/fixing the various table generations this would affect. This was a big oversight I made on my part for the initial push. For now I'm restricting this to only apply to indexed columns and not columns where |
bf05a19
to
c2edd50
Compare
…rom the table definition
66f7878
to
c5baea5
Compare
I believe I've pushed all of the changes needed for safely utilizing this sqlite optimization. I'm still doing testing and will update the pr once I complete that. |
Currently when processing the IN constraint in
xFilter
, sqlite core likes to callxFilter
once per value. This PR tells sqlite core to hand off all values on an IN constraint toxFilter
to reduce the amount of calls toxFilter
.Example: