Improve efficiency of matching during an aggregation pipeline.

XMLWordPrintableJSON

    • Fully Compatible
    • Query 13 (04/22/16)
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It's currently very expensive to perform a $match within the aggregation pipeline. This is mostly because the aggregation pipeline works with Documents, which are incompatible with the current MatchExpression::matchesBSON interface, so we have to construct an entirely new BSONObj to match on. There are two things we could do to make this more efficient:

      1. Instead of converting the entire Document to BSON, we could only convert the fields needed by the match. For example, if the match was {a: {$gte: 4}}, we would only need the field a from the document.
      2. We could extend the MatchExpression interface to support matching Documents. A Document is logically equivalent to a BSONObj, so it would just be a matter of adapting the matching to use a different API with the object.

              Assignee:
              Benjamin Murphy (Inactive)
              Reporter:
              Charlie Swanson
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: