summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/get_executor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/get_executor.cpp')
-rw-r--r--src/mongo/db/query/get_executor.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/query/get_executor.cpp b/src/mongo/db/query/get_executor.cpp
index 53263dde26d..87f8b82213a 100644
--- a/src/mongo/db/query/get_executor.cpp
+++ b/src/mongo/db/query/get_executor.cpp
@@ -1167,20 +1167,22 @@ inline bool isQuerySbeCompatible(OperationContext* opCtx,
size_t plannerOptions) {
invariant(cq);
auto expCtx = cq->getExpCtxRaw();
- auto sortPattern = cq->getSortPattern();
+ const auto& sortPattern = cq->getSortPattern();
const bool allExpressionsSupported = expCtx && expCtx->sbeCompatible;
const bool isNotCount = !(plannerOptions & QueryPlannerParams::IS_COUNT);
const bool doesNotContainMetadataRequirements = cq->metadataDeps().none();
- const bool doesNotSortOnDottedPath =
+ const bool doesNotSortOnMetaOrPathWithNumericComponents =
!sortPattern || std::all_of(sortPattern->begin(), sortPattern->end(), [](auto&& part) {
- return part.fieldPath && part.fieldPath->getPathLength() == 1;
+ return part.fieldPath &&
+ !FieldRef(part.fieldPath->fullPath()).hasNumericPathComponents();
});
// OP_QUERY style find commands are not currently supported by SBE.
const bool isNotLegacy = !CurOp::get(opCtx)->isLegacyQuery();
// Queries against a time-series collection are not currently supported by SBE.
const bool isQueryNotAgainstTimeseriesCollection = !(cq->nss().isTimeseriesBucketsCollection());
return allExpressionsSupported && isNotCount && doesNotContainMetadataRequirements &&
- doesNotSortOnDottedPath && isNotLegacy && isQueryNotAgainstTimeseriesCollection;
+ isNotLegacy && isQueryNotAgainstTimeseriesCollection &&
+ doesNotSortOnMetaOrPathWithNumericComponents;
}
} // namespace