diff --git a/arangod/Aql/ExecutionBlock.cpp b/arangod/Aql/ExecutionBlock.cpp index 7a5490de5a..977cc0d435 100644 --- a/arangod/Aql/ExecutionBlock.cpp +++ b/arangod/Aql/ExecutionBlock.cpp @@ -3543,6 +3543,28 @@ AqlItemBlock* GatherBlock::getSome (size_t atLeast, size_t atMost) { } +size_t GatherBlock::skipSome (size_t atLeast, size_t atMost) { + + if (_done) { + return 0; + } + + if (isSimple()) { + auto res = _dependencies.at(_atDep)->skipSome(atLeast, atMost); + while (res == 0 && _atDep < _dependencies.size() - 1) { + _atDep++; + res = _dependencies.at(_atDep)->skipSome(atLeast, atMost); + } + if (res == 0) { + _done = true; + } + return res; + //} else { // merge sort the results from the deps + + } + return 0; // to keep the compiler happy + +} // Local Variables: // mode: outline-minor // outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)" diff --git a/arangod/Aql/ExecutionBlock.h b/arangod/Aql/ExecutionBlock.h index 9e290c01f2..ff91f35fb8 100644 --- a/arangod/Aql/ExecutionBlock.h +++ b/arangod/Aql/ExecutionBlock.h @@ -1515,14 +1515,10 @@ public: AqlItemBlock* getSome (size_t, size_t); + size_t skipSome (size_t, size_t); + private: - /*int getOrSkipSome (size_t atLeast, - size_t atMost, - bool skipping, - AqlItemBlock*& result, - size_t& skipped);*/ - // the block is simple if we do not do merge sort . . . bool isSimple () { auto en = static_cast(getPlanNode());