From f4b562593d015f8b41a651c490a9a760a47fbd05 Mon Sep 17 00:00:00 2001 From: Darek Date: Sat, 24 Oct 2026 19:15:08 +0200 Subject: [PATCH] refactor(processor): pass Intersect's survivor count explicitly between rounds The no-argument setToUnfiltered() keeps the current size, which is what the next intersect round needs, but the call did not say so. Pass the size and note that twoWayIntersect leaves the surviving left IDs at the front of the key vector. Co-Authored-By: Claude Opus 5.5 --- src/processor/operator/intersect/intersect.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/processor/operator/intersect/intersect.cpp b/src/processor/operator/intersect/intersect.cpp index bd1962671f..037a330e93 100644 --- a/src/processor/operator/intersect/intersect.cpp +++ b/src/processor/operator/intersect/intersect.cpp @@ -170,7 +170,9 @@ void Intersect::intersectLists() { // Here we need to slice all selVectors that have been previously intersected, as all these // lists need to be selected synchronously to read payloads correctly. sliceSelVectors(selVectorsForIntersectedLists, leftSelVector); - leftSelVector.setToUnfiltered(); + // twoWayIntersect moved the surviving left IDs to the front of outKeyVector, so the next + // round reads its first getSelSize() entries in order. + leftSelVector.setToUnfiltered(leftSelVector.getSelSize()); selVectorsForIntersectedLists.push_back(intersectSelVectors[i + 1].get()); } outKeyVector->state->getSelVectorUnsafe().setSelSize(leftSelVector.getSelSize());