From 596680d87dcd9c01d768a265ee6e2c62cad84fca Mon Sep 17 00:00:00 2001 From: Richard Wesley Date: Sun, 17 Sep 2023 11:41:39 +1200 Subject: [PATCH] Internal #215: QUANTILE Reuse Restriction Reduce the insert range of Reuse to the current frames instead of the union of current and previous frames. --- src/core_functions/aggregate/holistic/quantile.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core_functions/aggregate/holistic/quantile.cpp b/src/core_functions/aggregate/holistic/quantile.cpp index eecee3ba970..4b8cff3c3eb 100644 --- a/src/core_functions/aggregate/holistic/quantile.cpp +++ b/src/core_functions/aggregate/holistic/quantile.cpp @@ -135,13 +135,13 @@ void ReuseIndexes(idx_t *index, const FrameBounds *currs, const FrameBounds *pre // Insert new indices if (j > 0) { // Subframe indices - const auto union_start = MinValue(currs[0].start, prevs[0].start); - const auto union_end = MaxValue(currs[nframes - 1].end, prevs[nframes - 1].end); - const FrameBounds last(union_end, union_end); + const auto currs_start = currs[0].start; + const auto currs_end = currs[nframes - 1].end; + const FrameBounds last(currs_end, currs_end); idx_t p = 0; idx_t c = 0; - for (auto idx = union_start; idx < union_end;) { + for (auto idx = currs_start; idx < currs_end;) { int overlap = 0; // Are we in the previous frame?