summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp b/src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp
index f3a96903a8e..272d7a1a80c 100644
--- a/src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp
+++ b/src/mongo/db/pipeline/document_source_internal_unpack_bucket.cpp
@@ -53,7 +53,6 @@
#include "mongo/db/pipeline/document_source_match.h"
#include "mongo/db/pipeline/document_source_project.h"
#include "mongo/db/pipeline/document_source_sample.h"
-#include "mongo/db/pipeline/document_source_sequential_document_cache.h"
#include "mongo/db/pipeline/document_source_single_document_transformation.h"
#include "mongo/db/pipeline/document_source_sort.h"
#include "mongo/db/pipeline/expression_context.h"
@@ -981,15 +980,6 @@ bool DocumentSourceInternalUnpackBucket::optimizeLastpoint(Pipeline::SourceConta
tryInsertBucketLevelSortAndGroup(AccumulatorDocumentsNeeded::kLastDocument);
}
-// Find $sequentialDocumentCache in the rest of the pipeline.
-Pipeline::SourceContainer::iterator findSequentialDocumentCache(
- Pipeline::SourceContainer::iterator start, Pipeline::SourceContainer::iterator end) {
- while (start != end && !dynamic_cast<DocumentSourceSequentialDocumentCache*>(start->get())) {
- start = std::next(start);
- }
- return start;
-}
-
Pipeline::SourceContainer::iterator DocumentSourceInternalUnpackBucket::doOptimizeAt(
Pipeline::SourceContainer::iterator itr, Pipeline::SourceContainer* container) {
invariant(*itr == this);
@@ -1085,18 +1075,6 @@ Pipeline::SourceContainer::iterator DocumentSourceInternalUnpackBucket::doOptimi
}
Pipeline::optimizeEndOfPipeline(itr, container);
-
- // $sequentialDocumentCache is full pipeline context aware. The call to
- // optimizeEndOfPipeline above isolates part of the pipeline and $sequentialDocumentCache
- // optimization applies incorrectly. The second call to
- // $sequentialDocumentCache->optimizeAt() is no-op, so it has to be forced.
- auto cache = findSequentialDocumentCache(std::next(itr), container->end());
- if (cache != container->end()) {
- auto cacheDocSource =
- dynamic_cast<DocumentSourceSequentialDocumentCache*>(cache->get());
- cacheDocSource->forceOptimizeAt(cache, container);
- }
-
if (std::next(itr) == container->end()) {
return container->end();
} else {