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

Explain scanAndOrder

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 01112017-cleanup
    • None
    • None
    • None

    Description

      The explanation of scanAndOrder on http://docs.mongodb.org/manual/reference/method/cursor.explain/#explain.scanAndOrder is either incorrect or confusing.

      It specifies:

      "scanAndOrder is a boolean that is true when the query cannot use the order of documents in the index for returning sorted results.

      When false, MongoDB must sort the documents after it receives the documents from a cursor."

      The second sentence doesn't seem to be correct. When scanAndOrder is false as I understand it, it has run through the index and therefore doesn't perform an in memory sort. The only circumstance where is would still perform an in-memory sort is if it was in a sharded environment and needs to sort the docs returned from the cursors on each shard.

      I'm not sure what was the intention of the second paragraph, but at the very least it seems confusing.

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            mattcampbell Matt Campbell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10 years, 28 weeks, 1 day ago