Regex set optimization when querying for chunks in index#2446
Merged
pstibrany merged 7 commits intocortexproject:masterfrom Apr 15, 2020
pstibrany:regex-set-optimization
Merged
Regex set optimization when querying for chunks in index#2446pstibrany merged 7 commits intocortexproject:masterfrom pstibrany:regex-set-optimization
pstibrany merged 7 commits intocortexproject:masterfrom
pstibrany:regex-set-optimization
Conversation
gouthamve
approved these changes
Apr 14, 2020
Contributor
gouthamve
left a comment
There was a problem hiding this comment.
LGTM! Thanks @pstibrany! There is conflict but other than that, I think this ready to go!
…kIdsByMetricNameMatcher. Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
pracucci
approved these changes
Apr 15, 2020
Contributor
pracucci
left a comment
There was a problem hiding this comment.
Very good job @pstibrany! LGTM 👏
Contributor
Author
|
Thanks for reviews! |
gouthamve
added a commit
to gouthamve/cortex
that referenced
this pull request
Apr 16, 2020
Similar to cortexproject#2446 Super useful for templated grafana dashboards which send matchers such as =~"a|b|c|d|" Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
3 tasks
2 tasks
gouthamve
added a commit
that referenced
this pull request
Apr 17, 2020
* Regex set optimisation when looking series in ingester Similar to #2446 Super useful for templated grafana dashboards which send matchers such as =~"a|b|c|d|e" Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com> * Add CHANGELOG entry Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com> * Add benchmark for set optimisation Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
cyriltovena
pushed a commit
to cyriltovena/loki
that referenced
this pull request
Jun 11, 2021
* Regex set optimisation when looking series in ingester Similar to cortexproject/cortex#2446 Super useful for templated grafana dashboards which send matchers such as =~"a|b|c|d|e" Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com> * Add CHANGELOG entry Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com> * Add benchmark for set optimisation Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements "regex set" optimization when querying chunks in index. If label matcher is in form label=~"a|b", then we can simply query index for label=a, label=b. This reduces number of fetched chunk IDs and matching we need to do in memory. (This is similar optimization to what Prometheus has in TSDB layer)
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]/cc @codesome