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

Generation of $expr doesn't use type information

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Query Execution

    Description

      We currently support dateDiff() only because the time field has a declared type that allows the removal of the extra checks on the input type.
      Writing the query

      [{$match:  {
                      "$expr": {
                          "$gt": [
                              {
                                  "$dateDiff": {
                                      "startDate": "$time",
                                      "endDate": new Date(datePrefix + 150),
                                      "unit": "millisecond"
                                  }
                              },
                              0
                          ]
                      }
                  }
      }]
      

      generates a plan using the non-optimized tree that includes a few calls to typeMatch() that, being not yet supported, don't allow the vectorized execution of dateDiff().

      Probably this is caused by not forwarding the type information into the conversion from ABT to EExpr

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            alberto.massari@mongodb.com Alberto Massari
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: