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

Allow aggregation $group operator to use an index

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • ALL

      Given an index on {a:1, b:1, c:1}, the following aggregations could make use of it to run more efficiently

      db.foo.aggregate([{$group: {_id: "$a", b_sum: {$sum: '$b'}}}])
      db.foo.aggregate([{$group: {_id: {a: "$a", b: "$b"}, c_sum: {$sum: '$c'}}}])
      

      And other similar aggregations

            Assignee:
            Unassigned Unassigned
            Reporter:
            joanna.cheng@mongodb.com Joanna Cheng
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: