Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/mongo/db/query/planner_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,11 @@ bool QueryPlannerAnalysis::explodeForSort(const CanonicalQuery& query,
if (!isOilExplodable(oil, iet)) {
break;
}
// We need not explode the fields in the desired sort order
auto elem = *kpIt;
if (elem.fieldNameStringData() == desiredSort.begin()->fieldNameStringData()) {
break;
}
numScans *= oil.intervals.size();
kpIt.next();
++boundsIdx;
Expand Down