summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/cqf_command_utils.cpp
diff options
context:
space:
mode:
authorHana Pearlman <hana.pearlman@mongodb.com>2022-08-26 15:10:45 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-26 16:50:33 +0000
commit3c96fa9dc6958539b7b8d28d818bd06335ef2268 (patch)
tree130ef8b859fb0558e94a73e3515728604a3210a9 /src/mongo/db/query/cqf_command_utils.cpp
parent1bb3510dbff6981839aca538ee0cf1d230878a9c (diff)
downloadmongo-3c96fa9dc6958539b7b8d28d818bd06335ef2268.tar.gz
SERVER-69140: Support hidden indexes in cqf
Diffstat (limited to 'src/mongo/db/query/cqf_command_utils.cpp')
-rw-r--r--src/mongo/db/query/cqf_command_utils.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/query/cqf_command_utils.cpp b/src/mongo/db/query/cqf_command_utils.cpp
index ac4a74e0efb..cce91454ca7 100644
--- a/src/mongo/db/query/cqf_command_utils.cpp
+++ b/src/mongo/db/query/cqf_command_utils.cpp
@@ -610,7 +610,13 @@ bool isEligibleCommon(const RequestType& request,
while (indexIterator->more()) {
const IndexDescriptor& descriptor = *indexIterator->next()->descriptor();
- if (descriptor.isPartial() || descriptor.hidden() || descriptor.isSparse() ||
+ if (descriptor.hidden()) {
+ // An index that is hidden will not be considered by the optimizer, so we don't need
+ // to check its eligibility further.
+ continue;
+ }
+
+ if (descriptor.isPartial() || descriptor.isSparse() ||
descriptor.getIndexType() != IndexType::INDEX_BTREE ||
!descriptor.collation().isEmpty()) {
return true;