[SERVER-57762] Create an internal, bucketed $geoWithin operator Created: 16/Jun/21  Updated: 29/Oct/23  Resolved: 09/Aug/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.1.0-rc0

Type: New Feature Priority: Major - P3
Reporter: David Percy Assignee: Ruoxin Xu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-57764 Push down $geoWithin past $_internalU... Closed
is depended on by SERVER-57765 Allow partial filter expression to us... Closed
is depended on by SERVER-58371 Allow $_internalBucketGeoWithin to sc... Closed
Related
is related to SERVER-60445 $_internalBucketGeoWithin on mixed ty... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query Optimization 2021-07-26, Query Optimization 2021-08-09, QO 2021-08-23
Participants:

 Description   

Currently when you use $geoWithin on a time-series collection, it can only be pushed down if the predicate is on a metadata field. We'd like to also push down geo predicates on measurements.

But $geoWithin can't express this bucket-level predicate. We should introduce a new internal-only operator, say "$_internalBucketGeoWithin", that can discard buckets that definitely don't contain points in the given region.

For example:

{$_internalUnpackBucket: ...}
{$match: {location: {$geoWithin: ...}}}

could be optimized to something like:

{$match: {$_internalBucketGeoWithin: {
  withinRegion: ...,
  field: "location",
  ...
}}}
{$_internalUnpackBucket: ...}
{$match: {location: {$geoWithin: ...}}}

The implementation could use control.min.location / control.max.location to quickly discard many buckets.

This ticket is only about creating the new operator. Optimization and indexing will be separate.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 06/Aug/21 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-57762 Create an internal, bucketed $geoWithin operator
Branch: master
https://github.com/mongodb/mongo/commit/b46c44c41849606ade03f8a9238aa6ea800bb87a

Comment by Githook User [ 06/Aug/21 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-57762 Create an internal, bucketed $geoWithin operator
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/8cc96cfdc19e9b4fadd6b676ab372f2235502387

Comment by Githook User [ 06/Aug/21 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-57762 Create an internal, bucketed $geoWithin operator
Branch: SERVER-57762
https://github.com/10gen/mongo-enterprise-modules/commit/daeda8e3eb75b955eb888ed1846029a052cbe569

Comment by David Percy [ 12/Jul/21 ]

This should be a MatchExpression (as opposed to DocumentSource) because we'll also want to allow it in a partial filter expression (SERVER-57765).

I think it should be a pathless match expression, because we want to allow it to read any field in the bucket.

Generated at Thu Feb 08 05:42:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.