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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • 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 }} ] },

    Description

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

      Attachments

        Activity

          People

            erin.zhu@mongodb.com Erin Zhu
            irina.yatsenko@mongodb.com Irina Yatsenko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: