summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/cost_model
diff options
context:
space:
mode:
authorAnton Korshunov <anton.korshunov@mongodb.com>2022-11-28 14:19:20 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-28 15:12:36 +0000
commitb1474e5c22fd2106c1e7c6493052e8fbc450e289 (patch)
tree84c30cb1b57836a437ebd90b11632a4efbdeb86d /src/mongo/db/query/cost_model
parente4e1b807a5e079dc9fff098294271b63966930e3 (diff)
downloadmongo-b1474e5c22fd2106c1e7c6493052e8fbc450e289.tar.gz
SERVER-71051 Make CE module less dependent on statistics module
Diffstat (limited to 'src/mongo/db/query/cost_model')
-rw-r--r--src/mongo/db/query/cost_model/SConscript2
-rw-r--r--src/mongo/db/query/cost_model/cost_estimator_impl.cpp (renamed from src/mongo/db/query/cost_model/cost_estimator.cpp)14
-rw-r--r--src/mongo/db/query/cost_model/cost_estimator_impl.h (renamed from src/mongo/db/query/cost_model/cost_estimator.h)4
-rw-r--r--src/mongo/db/query/cost_model/cost_estimator_test.cpp12
4 files changed, 16 insertions, 16 deletions
diff --git a/src/mongo/db/query/cost_model/SConscript b/src/mongo/db/query/cost_model/SConscript
index d8ce836096a..44649d53978 100644
--- a/src/mongo/db/query/cost_model/SConscript
+++ b/src/mongo/db/query/cost_model/SConscript
@@ -7,7 +7,7 @@ env = env.Clone()
env.Library(
target="query_cost_model",
source=[
- 'cost_estimator.cpp',
+ 'cost_estimator_impl.cpp',
'cost_model.idl',
'cost_model_manager.cpp',
'cost_model_utils.cpp',
diff --git a/src/mongo/db/query/cost_model/cost_estimator.cpp b/src/mongo/db/query/cost_model/cost_estimator_impl.cpp
index 3dea08ebd1f..55d2bf6ab5c 100644
--- a/src/mongo/db/query/cost_model/cost_estimator.cpp
+++ b/src/mongo/db/query/cost_model/cost_estimator_impl.cpp
@@ -27,7 +27,7 @@
* it in the license file.
*/
-#include "mongo/db/query/cost_model/cost_estimator.h"
+#include "mongo/db/query/cost_model/cost_estimator_impl.h"
#include "mongo/db/query/optimizer/defs.h"
@@ -404,12 +404,12 @@ private:
};
} // namespace
-CostAndCE CostEstimator::deriveCost(const Metadata& metadata,
- const Memo& memo,
- const PhysProps& physProps,
- const ABT::reference_type physNodeRef,
- const ChildPropsType& childProps,
- const NodeCEMap& nodeCEMap) const {
+CostAndCE CostEstimatorImpl::deriveCost(const Metadata& metadata,
+ const Memo& memo,
+ const PhysProps& physProps,
+ const ABT::reference_type physNodeRef,
+ const ChildPropsType& childProps,
+ const NodeCEMap& nodeCEMap) const {
const CostAndCEInternal result = CostDerivation::derive(
metadata, memo, physProps, physNodeRef, childProps, nodeCEMap, _coefficients);
return {CostType::fromDouble(result._cost), result._ce};
diff --git a/src/mongo/db/query/cost_model/cost_estimator.h b/src/mongo/db/query/cost_model/cost_estimator_impl.h
index 763351324b4..0ed094c02a9 100644
--- a/src/mongo/db/query/cost_model/cost_estimator.h
+++ b/src/mongo/db/query/cost_model/cost_estimator_impl.h
@@ -37,9 +37,9 @@ namespace mongo::cost_model {
/**
* Default costing for physical nodes with logical delegator (not-yet-optimized) inputs.
*/
-class CostEstimator : public optimizer::cascades::CostingInterface {
+class CostEstimatorImpl : public optimizer::cascades::CostEstimator {
public:
- CostEstimator(CostModelCoefficients coefficicients)
+ CostEstimatorImpl(CostModelCoefficients coefficicients)
: _coefficients{std::move(coefficicients)} {}
optimizer::CostAndCE deriveCost(const optimizer::Metadata& metadata,
diff --git a/src/mongo/db/query/cost_model/cost_estimator_test.cpp b/src/mongo/db/query/cost_model/cost_estimator_test.cpp
index 420da954b06..5b68139a72e 100644
--- a/src/mongo/db/query/cost_model/cost_estimator_test.cpp
+++ b/src/mongo/db/query/cost_model/cost_estimator_test.cpp
@@ -27,7 +27,7 @@
* it in the license file.
*/
-#include "mongo/db/query/cost_model/cost_estimator.h"
+#include "mongo/db/query/cost_model/cost_estimator_impl.h"
#include "mongo/db/query/cost_model/cost_model_gen.h"
#include "mongo/db/query/cost_model/cost_model_utils.h"
#include "mongo/db/query/optimizer/cascades/memo.h"
@@ -48,7 +48,7 @@ TEST(CostEstimatorTest, PhysicalScanCost) {
costModel.setScanStartupCost(startupCost);
costModel.setScanIncrementalCost(scanCost);
- CostEstimator costEstimator{costModel};
+ CostEstimatorImpl costEstimator{costModel};
optimizer::Metadata metadata{{}};
optimizer::cascades::Memo memo{};
@@ -94,7 +94,7 @@ TEST(CostEstimatorTest, PhysicalScanCostWithAdjustedCE) {
costModel.setScanStartupCost(startupCost);
costModel.setScanIncrementalCost(scanCost);
- CostEstimator costEstimator{costModel};
+ CostEstimatorImpl costEstimator{costModel};
optimizer::Metadata metadata{{}};
optimizer::cascades::Memo memo{};
@@ -130,7 +130,7 @@ TEST(CostEstimatorTest, IndexScanCost) {
costModel.setIndexScanStartupCost(startupCost);
costModel.setIndexScanIncrementalCost(indexScanCost);
- CostEstimator costEstimator{costModel};
+ CostEstimatorImpl costEstimator{costModel};
optimizer::Metadata metadata{{}};
optimizer::cascades::Memo memo{};
@@ -173,7 +173,7 @@ TEST(CostEstimatorTest, FilterAndEvaluationCost) {
costModel.setEvalIncrementalCost(evalCost);
costModel.setEvalStartupCost(startupCost);
- CostEstimator costEstimator{costModel};
+ CostEstimatorImpl costEstimator{costModel};
optimizer::Metadata metadata{{}};
optimizer::cascades::Memo memo{};
@@ -273,7 +273,7 @@ TEST(CostEstimatorTest, MergeJoinCost) {
nodeCEMap[evalNodeRight.cast<optimizer::Node>()] = ce;
- CostEstimator costEstimator{costModel};
+ CostEstimatorImpl costEstimator{costModel};
optimizer::Metadata metadata{{}};
optimizer::cascades::Memo memo{};