mirror of https://gitee.com/bigwinds/arangodb
simplification of fullcount code (#5074)
This commit is contained in:
parent
5decb66d01
commit
d500a503b1
|
@ -349,10 +349,7 @@ int LimitBlock::getOrSkipSome(size_t atLeast, size_t atMost, bool skipping,
|
|||
|
||||
if (_state == 0) {
|
||||
if (_fullCount) {
|
||||
// properly initialize fullcount value, which has a default of -1
|
||||
if (_engine->_stats.fullCount == -1) {
|
||||
_engine->_stats.fullCount = 0;
|
||||
}
|
||||
_engine->_stats.fullCount = 0;
|
||||
}
|
||||
|
||||
if (_offset > 0) {
|
||||
|
@ -405,13 +402,11 @@ int LimitBlock::getOrSkipSome(size_t atLeast, size_t atMost, bool skipping,
|
|||
while (true) {
|
||||
skipped = 0;
|
||||
AqlItemBlock* ignore = nullptr;
|
||||
ExecutionBlock::getOrSkipSome(atLeast, atMost, skipping, ignore,
|
||||
skipped);
|
||||
ExecutionBlock::getOrSkipSome(atLeast, atMost, skipping, ignore, skipped);
|
||||
|
||||
if (ignore != nullptr) {
|
||||
_engine->_stats.fullCount += static_cast<int64_t>(ignore->size());
|
||||
delete ignore;
|
||||
}
|
||||
TRI_ASSERT(ignore == nullptr || ignore->size() == skipped);
|
||||
_engine->_stats.fullCount += skipped;
|
||||
delete ignore;
|
||||
|
||||
if (skipped == 0) {
|
||||
break;
|
||||
|
|
|
@ -834,7 +834,7 @@ class LimitNode : public ExecutionNode {
|
|||
_fullCount(false) {}
|
||||
|
||||
LimitNode(ExecutionPlan* plan, size_t id, size_t limit)
|
||||
: ExecutionNode(plan, id), _offset(0), _limit(limit), _fullCount(false) {}
|
||||
: LimitNode(plan, id, 0, limit) {}
|
||||
|
||||
LimitNode(ExecutionPlan*, arangodb::velocypack::Slice const& base);
|
||||
|
||||
|
|
|
@ -92,5 +92,7 @@ ExecutionStats::ExecutionStats(VPackSlice const& slice)
|
|||
// note: fullCount is an optional attribute!
|
||||
if (slice.hasKey("fullCount")) {
|
||||
fullCount = slice.get("fullCount").getNumber<int64_t>();
|
||||
} else {
|
||||
fullCount = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue