Skip to content

Commit

Permalink
Merge pull request #18093 from jakesmith/HPCC-30938-count-seek-double…
Browse files Browse the repository at this point in the history
…-counting

HPCC-30938 checkCount/getCount double counting seeks

Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Nov 29, 2023
2 parents 92bba5b + 135f5f0 commit 299f970
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions system/jhtree/jhtree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2027,7 +2027,6 @@ unsigned __int64 CKeyCursor::getCount(KeyStatsCollector &stats)
{
reset();
unsigned __int64 result = 0;
unsigned lseeks = 0;
unsigned lastRealSeg = filter->lastRealSeg();
bool unfiltered = filter->isUnfiltered();
for (;;)
Expand All @@ -2037,23 +2036,20 @@ unsigned __int64 CKeyCursor::getCount(KeyStatsCollector &stats)
unsigned __int64 locount = getSequence();
endRange(lastRealSeg);
_ltEqual(stats);
lseeks++;
result += getSequence()-locount+1;
if (!incrementKey(lastRealSeg))
break;
}
else
break;
}
stats.noteSeeks(lseeks, 0, 0);
return result;
}

unsigned __int64 CKeyCursor::checkCount(unsigned __int64 max, KeyStatsCollector &stats)
{
reset();
unsigned __int64 result = 0;
unsigned lseeks = 0;
unsigned lastFullSeg = filter->lastFullSeg();
bool unfiltered = filter->isUnfiltered();
if (lastFullSeg == (unsigned) -1)
Expand All @@ -2071,7 +2067,6 @@ unsigned __int64 CKeyCursor::checkCount(unsigned __int64 max, KeyStatsCollector
unsigned __int64 locount = getSequence();
endRange(lastFullSeg);
_ltEqual(stats);
lseeks++;
result += getSequence()-locount+1;
if (max && (result > max))
break;
Expand All @@ -2081,7 +2076,6 @@ unsigned __int64 CKeyCursor::checkCount(unsigned __int64 max, KeyStatsCollector
else
break;
}
stats.noteSeeks(lseeks, 0, 0);
return result;
}

Expand Down

0 comments on commit 299f970

Please sign in to comment.