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

Clarity Issue: Covered Queries in Sharded Clusters

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • None
    • None

    Description

      Here's the doc

      In the section, "Covered Queries in Sharded Clusters," it says:

      An index cannot cover a query on a sharded collection when run against a mongos if the index does not contain the shard key, with the following exception for the _id index: If a query on a sharded collection only specifies a condition on the _id field and returns only the _id field, the _id index can cover the query when run against a mongos even if the _id field is not the shard key.

      Changed in version 3.0: In previous versions, an index cannot cover a query on a sharded collection when run against a mongos.

      I think it could be clearer, here. I would prefer if the version information were made up front, and then the update clarified that this was no longer a limitation:

      For versions earlier than MongoDB 3.0, an index cannot cover a query on a sharded collection when run against a mongos if the index does not contain the shard key, with the following exception for the _id index: If a query on a sharded collection only specifies a condition on the _id field and returns only the _id field, the _id index can cover the query when run against a mongos even if the _id field is not the shard key.

      Changed in version 3.0: MongoDB can now cover a query on a sharded collection when run against a mongos.

      Probably not a big deal, regardless, as it's not wrong, just a little potentially confusing.

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            william.cross William Cross
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              6 years, 4 weeks, 1 day ago