From 34ae8f620cda69798230cf3d9e3986e79580fa6f Mon Sep 17 00:00:00 2001 From: Benjamin Murphy Date: Fri, 29 Jan 2016 13:27:59 -0500 Subject: SERVER-19542 Refactored pipeline optimization. --- src/mongo/db/pipeline/pipeline.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/pipeline/pipeline.h') diff --git a/src/mongo/db/pipeline/pipeline.h b/src/mongo/db/pipeline/pipeline.h index 65ff1ad97e9..431933e159e 100644 --- a/src/mongo/db/pipeline/pipeline.h +++ b/src/mongo/db/pipeline/pipeline.h @@ -52,6 +52,8 @@ class Privilege; */ class Pipeline : public IntrusiveCounterUnsigned { public: + typedef std::list> SourceContainer; + /** * Create a pipeline from the command. * @@ -64,7 +66,7 @@ public: const BSONObj& cmdObj, const boost::intrusive_ptr& pCtx); - /// Helper to implement Command::checkAuthForCommand + // Helper to implement Command::checkAuthForCommand static Status checkAuthForCommand(ClientBasic* client, const std::string& dbname, const BSONObj& cmdObj); @@ -94,6 +96,11 @@ public: */ bool needsPrimaryShardMerger() const; + /** + * Modifies the pipeline, optimizing it by combining and swapping stages. + */ + void optimizePipeline(); + /** * Returns any other collections involved in the pipeline in addition to the collection the * aggregation is run on. @@ -189,7 +196,6 @@ private: Pipeline(const boost::intrusive_ptr& pCtx); - typedef std::deque> SourceContainer; SourceContainer sources; bool explain; -- cgit v1.2.1