Open
Description
Issue
Consider the following query:
sum(rate(metric{node="node1"}[5m]))/count(max_over_time(metric{node="node"}[6m]))
The MergeSelectsOptimizer
will try to optimize the LHS to matchers="{__name__='metric'}"
and filters="{node='node1'}"
However, since the range of the selectors are different they still end up being hashed to different values in the SelectorPool
.
The engine will end up making two selects to storage for {__name__='metric'}
.
But in this case, it would have been more optimal if the LHS wasn't optimized.
Should the MergeSelectsOptimizer
also consider the start, end and range of the selector when finding a replacement?
Metadata
Metadata
Assignees
Labels
No labels