-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Propagate label selectors across binary ops #8053
Description
See https://utcc.utoronto.ca/~cks/space/blog/sysadmin/PrometheusLabelNonOptimization for a good explanation. Summarising:
When we select node_filesystem_files{ host="$host", mountpoint="/" } - node_filesystem_files_free, we load all the series for node_filesystem_files_free when we could simply select a subset node_filesystem_files_free{ host="$host", mountpoint="/" }. This would have significant performance impact.
See also cortexproject/cortex#3253
I am not sure if this would require a query planner, but I can see us doing some pre-processing that rewrites the PromQL to do this. VictoriaMetrics is doing this: VictoriaMetrics/VictoriaMetrics@e9f2e2c
I am just curious what the implications around correctness would be.