Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-15221

Indicate that ONLY specific aggregation stages an utilize indexes

    XMLWordPrintableJSON

Details

    Description

      In https://www.mongodb.com/docs/manual/core/aggregation-pipeline-optimization/#std-label-aggregation-pipeline-optimization-indexes-and-filters the instructions are not explicit, and the resulting ambiguity can confuse users who are unsure as to why their pipeline didn't use an index.

      The query planner analyzes an aggregation pipeline to determine if indexes can be used to improve pipeline performance.

      The following list shows some pipeline stages that can use indexes:

      This should be reworded as:

      The query planner analyzes an aggregation pipeline to determine if indexes from the collection targeted by the aggregate command can be used to improve pipeline performance. Only the first pipeline stage can benefit from indexes, and only if that stage is one of the following:

      Attachments

        Activity

          People

            nick.villahermosa@mongodb.com Nick Villahermosa
            alex.bevilacqua@mongodb.com Alex Bevilacqua
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1 year, 8 weeks, 2 days ago