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

Duplicated predicates pushed down into collection access for $match over time-series

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • ALL
    • Hide

      Create a time-series collection with metaField called "meta".

      db.ts.explain().aggregate([{$match: {$expr: {$lt: ["$meta",1]}}}, {$match: {$expr: {$gt: ["$meta", 1]}}}])
      ...
      "parsedQuery" : {
              "$and" : [
                      {"$expr" : {"$gt" : ["$meta", {"$const" : 1 }] }},
                      {"meta" : {"$_internalExprGt" : 1 }},
                      {"meta" : {"$_internalExprGt" : 1 }}
              ]
      },
      
      Show
      Create a time-series collection with metaField called "meta". db.ts.explain().aggregate([{$match: {$expr: {$lt: [ "$meta" ,1]}}}, {$match: {$expr: {$gt: [ "$meta" , 1]}}}]) ... "parsedQuery" : { "$and" : [ { "$expr" : { "$gt" : [ "$meta" , { "$ const " : 1 }] }}, { "meta" : { "$_internalExprGt" : 1 }}, { "meta" : { "$_internalExprGt" : 1 }} ] },

      When multiple $match stages use expressions on the metaField we might create duplicated predicates on the bucketing collection

            Assignee:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            irina.yatsenko@mongodb.com Irina Yatsenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: