-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
QI 2023-05-29, QI 2023-06-12
The following code will execute a COLLSCAN.
db.createCollection("c", { clusteredIndex: { key: { _id: 1 }, unique: true } })); db.c.createIndex({ a: 1 }); db.c.insert({ b: "foo", a: 1, c: 2 }); db.c.explain().find({ $or: [{ _id: 123 }, { a: 5 }] }).finish();
However, a better plan would be a OR stage with a CLUSTERED_IXSCAN and a IXSCAN stage. Currently, CLUSTERED_IXSCAN plans are not considered when we subplan the children of $or queries. We only try IXSCAN for the children and miss out on better plans. This will also address the bug in SERVER-61259. If we can support CLUSTERED_IXSCAN in the children of $or queries then we can support $text queries under $or, since we will not need to fallback on a collection scan.
- is depended on by
-
SERVER-61259 $or queries with text indexes fail on clustered collections
- Closed
-
SERVER-77867 Investigate when to avoid pushing down FETCH for rooted or queries on clustered collections
- Backlog
- related to
-
SERVER-78045 Nested $or queries with $text nodes should use the $or with clustered collection scan
- Backlog
-
SERVER-77601 Support sort keys in clustered collection scans in SBE
- Backlog
-
SERVER-78044 Cache rooted $or queries that use clustered collection scans in SBE
- Backlog