Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-58059

Support partial indexes on time-series measurements

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Storage Execution

      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 } },
                  ] }
              }
          ]
      }
      

            Assignee:
            backlog-server-execution Backlog - Storage Execution Team
            Reporter:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'slack.nextup.jira:slack-integration-plus'. Please contact your Jira administrators.