This repository was archived by the owner on Aug 23, 2023. It is now read-only.
Performance optimizations for meta tag queries #1517
Merged
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 does 4 things, in 4 different commits, so I recommend reviewing them separately:
TagQueryWorkers
. When building the initial result set, if the query expression includes a meta tag, then we instantiate a sub-query in a go routine for each of the involved meta records. If a meta tag has a really large number of meta records associated with it (f.e.dc=dc1
resulting inhost=host1
,host=host2
,host=host3
etc) then we don't want to start all those go routines for the sub queries at once. So this introduces a gate to limit their concurrency..getIds()
when calling it and.getIds()
is now a blocking method.master
.