[SERVER-59163] Enable partial indexes on time-series collections Created: 06/Aug/21  Updated: 29/Oct/23  Resolved: 21/Jan/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0

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

Issue Links:
Depends
depends on SERVER-60672 Simpler pushdown when timeseries coll... Closed
is depended on by SERVER-58059 Support partial indexes on time-serie... Closed
is depended on by SERVER-55719 Support partial indexes on time-serie... Closed
Duplicate
is duplicated by SERVER-63316 Object.extend should handle Date objects Closed
Problem/Incident
causes SERVER-63000 createPredicatesOnBucketLevelField wi... Closed
Related
related to SERVER-59505 Time-series query on mixed, nested me... Closed
related to SERVER-62954 fix macos dyld limit Closed
related to SERVER-59508 Support $or, $in and multi-level expr... Closed
is related to SERVER-63316 Object.extend should handle Date objects Closed
Backwards Compatibility: Fully Compatible
Sprint: QO 2021-09-06, QO 2021-09-20, QO 2021-10-04, QO 2021-11-29, QO 2021-12-13, QO 2021-12-27, QO 2022-01-10, QO 2022-01-24
Participants:
Linked BF Score: 69

 Description   

When someone creates a partial index on a time-series collection, internally we will create a partial index on the buckets collection. The user specifies the partialFilterExpression as a predicate on events, but we'll translate it to a predicate on buckets.

This sounds identical to how we push down $match predicates past the $_internalUnpackBucket stage. We should make sure that logic is factored out into some helper that can be called both from DocumentSource::optimize() and from CmdCreateIndexes.

For example:

  • Predicates on metadata are pushed down exactly
  • $lt predicates on measurements are pushed down as $lt on control.min
  • $geoWithin is pushed down as $_internalBucketGeoWithin


 Comments   
Comment by Githook User [ 21/Jan/22 ]

Author:

{'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}

Message: SERVER-59163 Allow creating partial indexes on time-series collections
Branch: master
https://github.com/mongodb/mongo/commit/610898a1ccec0afc3d38f7c29f2553d5b6102d30

Comment by Githook User [ 21/Jan/22 ]

Author:

{'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}

Message: SERVER-59163 Move time-series predicate rewrites to bucket_unpacker

We will want to use these rewrites when creating a partial index. But to
avoid a cyclic dependency, we don't want to depend on all of the
'pipeline' library.
Branch: master
https://github.com/mongodb/mongo/commit/e446bef952d2ef42ae799e9b88c877b3fe0be6e4

Comment by David Percy [ 13/Oct/21 ]

When we generate the bucket-level partialFilterExpression, we should use the simpler rewrite implemented in SERVER-60672.

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