summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/sbe/stages/hash_agg.cpp
diff options
context:
space:
mode:
authorAlexander Ignatyev <alexander.ignatyev@mongodb.com>2021-09-17 08:51:15 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-17 09:29:18 +0000
commit2a82df1a0433d21bfb55ca7e6ff2b0d47822d34c (patch)
tree0de92bc8be9e07b9945afc511f873013014372b5 /src/mongo/db/exec/sbe/stages/hash_agg.cpp
parentf508575e0a4f72979247176c279c5497da0a260a (diff)
downloadmongo-2a82df1a0433d21bfb55ca7e6ff2b0d47822d34c.tar.gz
SERVER-59331 Add PlanCache's and EExpression's getCompileTimeSize() functions to calculate compile-time size of SBE Plan
Diffstat (limited to 'src/mongo/db/exec/sbe/stages/hash_agg.cpp')
-rw-r--r--src/mongo/db/exec/sbe/stages/hash_agg.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/exec/sbe/stages/hash_agg.cpp b/src/mongo/db/exec/sbe/stages/hash_agg.cpp
index e54d18e41bf..5ae9c234c81 100644
--- a/src/mongo/db/exec/sbe/stages/hash_agg.cpp
+++ b/src/mongo/db/exec/sbe/stages/hash_agg.cpp
@@ -33,6 +33,8 @@
#include "mongo/util/str.h"
+#include "mongo/db/exec/sbe/size_estimator.h"
+
namespace mongo {
namespace sbe {
HashAggStage::HashAggStage(std::unique_ptr<PlanStage> input,
@@ -322,5 +324,15 @@ std::vector<DebugPrinter::Block> HashAggStage::debugPrint() const {
return ret;
}
+
+size_t HashAggStage::estimateCompileTimeSize() const {
+ size_t size = sizeof(*this);
+ size += size_estimator::estimate(_children);
+ size += size_estimator::estimate(_gbs);
+ size += size_estimator::estimate(_aggs);
+ size += size_estimator::estimate(_seekKeysSlots);
+ return size;
+}
+
} // namespace sbe
} // namespace mongo