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

Optimize away entire pipeline if it can be answered using a query

    • Fully Compatible
    • Query 2017-04-17, Query 2017-05-08, Query 2017-05-29, Query 2019-03-11, Query 2019-03-25, Query 2019-04-08
    • 0

      An aggregation pipeline can be used to represent a query, like the following:

      db.example.aggregate([{$project: {excluded: 0}}, {$match: {predicate: true}}]);
      

      In these cases, it would be more efficient to skip the aggregation layer, and execute the entire computation using a query.

      It is expected that pipelines like the above pipeline will be much more common once non-materialized views are introduced in SERVER-142.

            Assignee:
            anton.korshunov@mongodb.com Anton Korshunov
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            2 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:
              Resolved: