[SERVER-58059] Support partial indexes on time-series measurements Created: 24/Jun/21  Updated: 06/Dec/22  Resolved: 16/Sep/21

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

Type: New Feature Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Backlog - Storage Execution Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-57765 Allow partial filter expression to us... Closed
depends on SERVER-59163 Enable partial indexes on time-series... Closed
Related
related to SERVER-55719 Support partial indexes on time-serie... Closed
Assigned Teams:
Storage Execution
Participants:

 Description   

When creating an index on a time-series view, the partial filter expression will be pushed down the same way query predicates are.

  • Predicates on metadata are unchanged, except for renaming the field.
  • Predicates on measurements become coarser: they use control.min / control.max.

For example, this createIndexes command on the view:

{
    createIndexes: "events",
    indexes: [
        {
            key: { a : 1 },
            partialFilterExpression: { $and: [
                { 'meta.sensor_type': 'temperature' }
                { value: { $gt: 70 } },
            ] }
        }
    ]
}

will be equivalent to this command on the underlying buckets collection:

{
    createIndexes: "system.buckets.events",
    indexes: [
        {
            key: { control.min.a : 1, control.max.a : 1 },
            partialFilterExpression: { $and: [
                { 'meta.sensor_type': 'temperature' }
                { control.max.value: { $gt: 70 } },
            ] }
        }
        {
            key: { control.max.a : 1, control.min.a : 1 },
            partialFilterExpression: { $and: [
                { 'meta.sensor_type': 'temperature' }
                { control.max.value: { $gt: 70 } },
            ] }
        }
    ]
}



 Comments   
Comment by Gregory Wlodarek [ 16/Sep/21 ]

SERVER-59163 will add support for this.

Comment by David Percy [ 08/Jul/21 ]

To handle $geoWithin in the filter on measurements, we'll need to support $_internalBucketedGeoWithin in the filter on buckets: SERVER-57765.

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