summaryrefslogtreecommitdiff
path: root/src/mongo/db/query
diff options
context:
space:
mode:
authorMatt Boros <matt.boros@mongodb.com>2022-06-27 20:28:06 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-06-27 22:51:21 +0000
commit4026c62f484991122e39c8234382c33c5b30ad5e (patch)
treef03531a1aa26bb30ef99d083c46235ab3d42d85c /src/mongo/db/query
parent5ccf7596dfc7442b312f867564bde8e111c86df7 (diff)
downloadmongo-4026c62f484991122e39c8234382c33c5b30ad5e.tar.gz
SERVER-62648 Eliminate std::cerr from new optimizer logging
Diffstat (limited to 'src/mongo/db/query')
-rw-r--r--src/mongo/db/query/ce/ce_sampling.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mongo/db/query/ce/ce_sampling.cpp b/src/mongo/db/query/ce/ce_sampling.cpp
index a39ca81e0a3..3ee77deaf93 100644
--- a/src/mongo/db/query/ce/ce_sampling.cpp
+++ b/src/mongo/db/query/ce/ce_sampling.cpp
@@ -29,11 +29,15 @@
#include "mongo/db/query/ce/ce_sampling.h"
+#include "mongo/db/commands/cqf/cqf_command_utils.h"
#include "mongo/db/exec/sbe/abt/abt_lower.h"
#include "mongo/db/query/optimizer/cascades/ce_heuristic.h"
#include "mongo/db/query/optimizer/explain.h"
#include "mongo/db/query/optimizer/utils/abt_hash.h"
#include "mongo/db/query/optimizer/utils/memo_utils.h"
+#include "mongo/logv2/log.h"
+
+#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kQuery
namespace mongo::optimizer::cascades {
@@ -191,7 +195,11 @@ private:
}
_selectivityCacheMap.emplace(std::move(abtTree), selectivity);
- std::cerr << "Sampling sel.: " << selectivity << "\n";
+
+ OPTIMIZER_DEBUG_LOG(6264805,
+ 5,
+ "CE sampling estimated filter selectivity",
+ "selectivity"_attr = selectivity);
return selectivity * childResult;
}
@@ -207,9 +215,11 @@ private:
properties::ProjectionRequirement{ProjectionNameVector{sampleSumProjection}},
std::move(abtTree));
- std::cerr << "********* Sampling ABT *********\n";
- std::cerr << ExplainGenerator::explainV2(abtTree);
- std::cerr << "********* Sampling ABT *********\n";
+
+ OPTIMIZER_DEBUG_LOG(6264806,
+ 5,
+ "Estimate selectivity ABT",
+ "explain"_attr = ExplainGenerator::explainV2(abtTree));
if (!_phaseManager.optimize(abtTree)) {
return {false, {}};