-
Notifications
You must be signed in to change notification settings - Fork 54
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
Push boolean operations into scanners #338
Comments
As far as I can understand, the ability to consider certain PromQL expressions as sample selectors and evaluate them directly in scanners is to optimize the query execution process. By applying the binary operation directly in the vector selector (or scanner), unnecessary samples that do not match the binary operation can be avoided, leading to more efficient query evaluation. As a potential optimization, does implementing a custom logical operator injected at the instantiation of the engine to handle the specific PromQL expressions that can be directly evaluated in scanners feels right to you? Should I try to solve this issue (I may need some help though)? @fpetkovski |
Hi @harsh-ps-2003, thank you for looking into this. Instead of a new operator, I would suggest adding a filtering function to the vector scanner which would take in a step vector and produce a new step vector with filtered samples. |
following your suggestion @fpetkovski I did the following changes in vector selector :
to filter the samples through vector scanner. But I dont know how to test whether my code is working or not! Any directions? |
I suggest that you add a new test case in this test and then we can see if your change works. Feel free to raise a PR with the new test and your change. |
I tried to solve the issue, but it seems that I am unable to do so. Still I am making a draft PR so that you could see what am I messing up. |
Certain PromQL expression can be considered as (sample) selectors and can be evaluated directly in scanners.
One example is:
For this query, we could apply
== 1
directly into the vector_selector (maybe we should rename this to vector_scanner) and avoid emitting samples which do not match that binary operation.The text was updated successfully, but these errors were encountered: