From 96b7de6736fcdf560c0a19fb9b5a5fb9561f0614 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 3 Feb 2022 00:26:14 +0200 Subject: [PATCH] app/vmselect/promql: clarify comments on why the right side of `if` and `and` operators are executed at first --- app/vmselect/promql/eval.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/vmselect/promql/eval.go b/app/vmselect/promql/eval.go index 962d98c6d..f13a9b7d5 100644 --- a/app/vmselect/promql/eval.go +++ b/app/vmselect/promql/eval.go @@ -285,10 +285,10 @@ func evalExpr(ec *EvalConfig, e metricsql.Expr) ([]*timeseries, error) { var tssLeft, tssRight []*timeseries switch strings.ToLower(be.Op) { case "and", "if": - // Fetch right-side series at first, since the left side of `and` and `if` operator - // usually contains lower number of time series. This should produce more specific label filters - // for the left side of the query. This, in turn, should reduce the time to select series - // for the left side of the query. + // Fetch right-side series at first, since it usually contains + // lower number of time series for `and` and `if` operator. + // This should produce more specific label filters for the left side of the query. + // This, in turn, should reduce the time to select series for the left side of the query. tssRight, tssLeft, err = execBinaryOpArgs(ec, be.Right, be.Left, be) default: tssLeft, tssRight, err = execBinaryOpArgs(ec, be.Left, be.Right, be)