From 03cd93bf1a73606b0794ef48345c3a8a4ed2e0ba Mon Sep 17 00:00:00 2001 From: Roman Khavronenko Date: Wed, 29 Sep 2021 00:35:14 +0300 Subject: [PATCH] app/vmselect: rm `quantile_over_time` fast-path optimisations (#1662) The removed fast path optimisations weren't consistent with `quantile` function behavior and results into discrepancy. Specifically, results didn't match in cases when: * 0 < phi > 1; * values contain only one element. Signed-off-by: hagen1778 --- app/vmselect/promql/rollup.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/vmselect/promql/rollup.go b/app/vmselect/promql/rollup.go index b14cebaf6..3d306a5e3 100644 --- a/app/vmselect/promql/rollup.go +++ b/app/vmselect/promql/rollup.go @@ -1112,13 +1112,6 @@ func newRollupQuantile(args []interface{}) (rollupFunc, error) { // There is no need in handling NaNs here, since they must be cleaned up // before calling rollup funcs. values := rfa.values - if len(values) == 0 { - return rfa.prevValue - } - if len(values) == 1 { - // Fast path - only a single value. - return values[0] - } phi := phis[rfa.idx] qv := quantile(phi, values) return qv