diff options
Diffstat (limited to 'src/mongo/db/query/planner_analysis.cpp')
-rw-r--r-- | src/mongo/db/query/planner_analysis.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mongo/db/query/planner_analysis.cpp b/src/mongo/db/query/planner_analysis.cpp index 0dcde5c00d7..942d27d7512 100644 --- a/src/mongo/db/query/planner_analysis.cpp +++ b/src/mongo/db/query/planner_analysis.cpp @@ -42,6 +42,7 @@ #include "mongo/db/matcher/expression_geo.h" #include "mongo/db/query/query_planner.h" #include "mongo/db/query/query_planner_common.h" +#include "mongo/logv2/log.h" #include "mongo/util/log.h" namespace mongo { @@ -344,7 +345,10 @@ std::unique_ptr<QuerySolutionNode> addSortKeyGeneratorStageIfNeeded( std::unique_ptr<ProjectionNode> analyzeProjection(const CanonicalQuery& query, std::unique_ptr<QuerySolutionNode> solnRoot, const bool hasSortStage) { - LOG(5) << "PROJECTION: Current plan is:\n" << redact(solnRoot->toString()); + LOGV2_DEBUG(20949, + 5, + "PROJECTION: Current plan is:\n{solnRoot}", + "solnRoot"_attr = redact(solnRoot->toString())); // If the projection requires the entire document we add a fetch stage if not present. Otherwise // we add a fetch stage if we are not covered. @@ -644,8 +648,11 @@ bool QueryPlannerAnalysis::explodeForSort(const CanonicalQuery& query, // Too many ixscans spoil the performance. if (totalNumScans > (size_t)internalQueryMaxScansToExplode.load()) { - LOG(5) << "Could expand ixscans to pull out sort order but resulting scan count" - << "(" << totalNumScans << ") is too high."; + LOGV2_DEBUG(20950, + 5, + "Could expand ixscans to pull out sort order but resulting scan " + "count({totalNumScans}) is too high.", + "totalNumScans"_attr = totalNumScans); return false; } @@ -705,7 +712,10 @@ QuerySolutionNode* QueryPlannerAnalysis::analyzeSort(const CanonicalQuery& query BSONObj reverseSort = QueryPlannerCommon::reverseSortObj(sortObj); if (sorts.end() != sorts.find(reverseSort)) { QueryPlannerCommon::reverseScans(solnRoot); - LOG(5) << "Reversing ixscan to provide sort. Result: " << redact(solnRoot->toString()); + LOGV2_DEBUG(20951, + 5, + "Reversing ixscan to provide sort. Result: {solnRoot}", + "solnRoot"_attr = redact(solnRoot->toString())); return solnRoot; } |