-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
Query Optimization 2021-07-26, Query Optimization 2021-08-09
-
127
When considering whether a $geoWithin partial index can be used to satisfy a query, currently we treat the $geoWithin opaquely, so only queries that explicitly mention that region can use the index. For example,
coll.createIndex({loc: '2dsphere'}, {partialFilterExpression: {loc: {$geoWithin: ... usa ... }}}); coll.find({loc: {$geoWithin: ... usa ... }}); // indexed coll.find({$and: [ // indexed {loc: {$geoWithin: ... usa ... }}, {loc: {$geoWithin: ... nyc ... }}, ]}); coll.find({loc: {$geoWithin: ... nyc ... }}); // not indexed
The third query should be indexed, because nyc is geometrically contained in usa.
- causes
-
SERVER-73242 Partial index with $geoWithin filter crashes when querying a big polygon document
- Backlog
- depends on
-
SERVER-57763 Allow partial filter expression to use $geoWithin
- Closed
- related to
-
SERVER-73235 Replace invariant with uassert in geometry_container
- Closed