[DOCS-1777] Explain scanAndOrder Created: 06/Aug/13  Updated: 11/Jan/17  Resolved: 06/Aug/13

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Bug Priority: Minor - P4
Reporter: Matt Campbell Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 10 years, 28 weeks, 1 day ago

 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.



 Comments   
Comment by auto [ 06/Aug/13 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-1777: clarifying explain.scanAndOrder
Branch: master
https://github.com/mongodb/docs/commit/785a655f3a030394a4ce1d251877c35fbf97a36e

Generated at Thu Feb 08 07:41:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.