Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Optimize autocomplete queries #1514

Merged
merged 5 commits into from
Nov 1, 2019
Merged

Optimize autocomplete queries #1514

merged 5 commits into from
Nov 1, 2019

Conversation

replay
Copy link
Contributor

@replay replay commented Oct 31, 2019

This adds an optimization to make autocomplete requests faster.
It works like this:
For populating the auto complete value list we need to first execute the query specified, we then take the result set and enrich it with meta tags that match each of the metrics in the result set. From the set of the metric tags and enriched meta tags we then build the list of values to return to autocomplete requests.
The optimization which this PR implements is that in the case of autocomplete requests its not necessary to enrich every metric in the result set with all meta tags which match it, every meta tag only needs to enrich one metric in the result set and that will be sufficient for it to be taken into account when building the list of values to return. That way we can skip a lot of redundant enriching of metrics in the result set.

It also adds and refactors some unit tests.

Copy link
Contributor

@robert-milan robert-milan left a comment

Choose a reason for hiding this comment

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

LGTM

@replay replay force-pushed the optimize_autocomplete_queries branch from 024c95c to 44b4240 Compare November 1, 2019 14:47
@replay
Copy link
Contributor Author

replay commented Nov 1, 2019

rebased this onto the latest master

@replay replay merged commit ccaecc2 into master Nov 1, 2019
@replay replay deleted the optimize_autocomplete_queries branch November 1, 2019 15:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants