@@ -69,7 +69,7 @@ class SecondaryIndex_c : public Index_i
69
69
bool Setup ( const std::string & sFile , std::string & sError );
70
70
71
71
bool CreateIterators ( std::vector<BlockIterator_i *> & dIterators, const Filter_t & tFilter, const RowidRange_t * pBounds, uint32_t uMaxValues, int64_t iRsetSize, int iCutoff, std::string & sError ) const override ;
72
- bool CalcCount ( uint32_t & uCount, const common::Filter_t & tFilter, std::string & sError ) const override ;
72
+ bool CalcCount ( uint32_t & uCount, const common::Filter_t & tFilter, uint32_t uMaxValues, std::string & sError ) const override ;
73
73
uint32_t GetNumIterators ( const common::Filter_t & tFilter ) const override ;
74
74
bool IsEnabled ( const std::string & sName ) const override ;
75
75
int64_t GetCountDistinct ( const std::string & sName ) const override ;
@@ -485,7 +485,7 @@ bool SecondaryIndex_c::CreateIterators ( std::vector<BlockIterator_i *> & dItera
485
485
}
486
486
487
487
488
- bool SecondaryIndex_c::CalcCount ( uint32_t & uCount, const common::Filter_t & tFilter, std::string & sError ) const
488
+ bool SecondaryIndex_c::CalcCount ( uint32_t & uCount, const common::Filter_t & tFilter, uint32_t uMaxValues, std::string & sError ) const
489
489
{
490
490
uCount = 0 ;
491
491
@@ -500,15 +500,22 @@ bool SecondaryIndex_c::CalcCount ( uint32_t & uCount, const common::Filter_t & t
500
500
if ( !FixupFilter ( tFixedFilter, tFilter, *pCol ) )
501
501
return false ;
502
502
503
+ bool bExclude = tFixedFilter.m_bExclude ;
504
+ tFixedFilter.m_bExclude = false ;
505
+
503
506
switch ( tFixedFilter.m_eType )
504
507
{
505
508
case FilterType_e::VALUES:
506
509
uCount = CalcValsRows ( tFixedFilter );
510
+ if ( bExclude )
511
+ uCount = uMaxValues - uCount;
507
512
return true ;
508
513
509
514
case FilterType_e::RANGE:
510
515
case FilterType_e::FLOATRANGE:
511
516
uCount = CalcRangeRows ( tFixedFilter );
517
+ if ( bExclude )
518
+ uCount = uMaxValues - uCount;
512
519
return true ;
513
520
514
521
default :
0 commit comments