From 357eab2d7b93759e31927b1bdf62b119ed2d2db2 Mon Sep 17 00:00:00 2001 From: Ilya Kuznetsov Date: Fri, 4 Aug 2023 17:16:37 +0200 Subject: [PATCH] fixed bitmap union selection logic --- secondary/secondary.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/secondary/secondary.cpp b/secondary/secondary.cpp index 69e70953..b5bb9e6f 100644 --- a/secondary/secondary.cpp +++ b/secondary/secondary.cpp @@ -307,6 +307,8 @@ int64_t SecondaryIndex_c::GetValsRows ( std::vector * pIterat if ( !PrepareBlocksValues ( tFilter, pIterators ? &dBlocksIt : nullptr, uBlockBaseOff, iNumIterators ) ) return 0; + iNumIterators = std::min ( (int64_t)tFilter.m_dValues.size(), iNumIterators ); + if ( !pIterators ) return iNumIterators; @@ -539,10 +541,7 @@ uint32_t SecondaryIndex_c::GetNumIterators ( const common::Filter_t & tFilter ) switch ( tFixedFilter.m_eType ) { case FilterType_e::VALUES: - { - uint32_t uNumIterators = GetValsRows ( nullptr, tFixedFilter, nullptr, 0, 0, INT_MAX ); - return std::min ( (uint32_t)tFixedFilter.m_dValues.size(), uNumIterators ); - } + return GetValsRows ( nullptr, tFixedFilter, nullptr, 0, 0, INT_MAX ); case FilterType_e::RANGE: case FilterType_e::FLOATRANGE: