Skip to content
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

dedupe index on all the queries for a table instead of query batches #3338

Merged

Conversation

sandeepsukhani
Copy link
Contributor

What this PR does / why we need it:
Series and Labels APIs do a lot of index queries. When there are multiple labels in the query there is a chance that we get lot of duplicate across queries when the files are not compacted yet. This PR creates a single IndexDeduper for all the queries per table to dedupe the index across the table not per batch.
This PR also changes sync.Mutex to sync.RWMutex to allow concurrent checks of already seen index entries.

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sandeepsukhani sandeepsukhani merged commit 3ff0881 into grafana:master Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants