-
Notifications
You must be signed in to change notification settings - Fork 295
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
Use INTERSECT and UNION for multiple filters in generated query #2725
Comments
do you have any performance benchmark numbers for this one or is this more speculative? |
Yeah, it's kinda of speculative but I can get some data |
For the above queries, with db
The first query took around Additional context
|
I think one limitation that this exposes is that if we use union to join multiple filters, we are more likely to be hit by the limit of values in the IN statement. But I think it's a problem with our existing queries anyway... not a problem for this PR, but we should perhaps add some more documentation. |
A suggestion to use
Intersect
orUnion
of the resultingresourceUuid
of the index table subqueries depending on theSearch
operation. This might help reduce redundancy if sameresourceUuid
appears across the tables or in the case of operationAND
,resourceUuid
doesn't appear.Example
Query generated for multiple filters currently uses multiple ANDs across the different index tables
An example to currently generated query
May be replaced with
The text was updated successfully, but these errors were encountered: