-
Notifications
You must be signed in to change notification settings - Fork 958
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
Improve LongRange execution for ranges that have min value as Long.MIN_VALUE and max value as Long.MAX_VALUE or min as 0, and max as 2^64-1 #13375
Comments
That sounds interesting, I can take a look at |
I suspect that existing benchmarks won't show needle moving results if they don't have enough queries that can be optimized through this opto. The change is still a positive one tho. We may need to benchmark it on a query set that specifically has a lot of these "full range from 0->Long.MAX_VALUE" clauses. |
Yes, I'm gathering some specific numbers for this exact case. I'll also suspect that this rewriting should've a purely positive effect, especially considering that you've a max of |
Is it valid to rewrite to match all docs though? Some docs may lack a value, and I didn't think we would match in that case. |
I took a first pass at this and also noticed that WDYT @msokolov ? |
+1, that should work. |
Description
At Amazon Search, we came across a lot of client queries that were specifying the min value as 0, and the max value as Long.MAX_VALUE.
We don't use the associated ValueSourceQuery query internally, but use a custom logic for filtering.
An improvement here would be to rewrite ValueSourceQuery to a MatchAllDocsQuery if we detect that the min and max value are the same as the min and max value of Long.
I think we will have to check for something like (
minVal==0
andmaxVal==2^64-1
) or (minVal==Long.MIN_VALUE
andmaxVal==Long.MAX_VALUE
) since we will have to cover both signed and unsigned cases.We can implement similar logic for DoubleRange as well.
The text was updated successfully, but these errors were encountered: