[DOCS-4824] Clarify how distinct command uses indexes Created: 13/Feb/15  Updated: 13/Nov/23  Resolved: 22/Feb/22

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.0.0, 4.2.0, 4.4.0, 5.0.0, 5.2.0, 5.3.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Sherry Ger Assignee: Jason Price
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:
Days since reply: 9 years, 5 days ago
Epic Link: DOCSP-1769
Story Points: 2

 Description   

Link to text
http://docs.mongodb.org/manual/reference/command/distinct/

The following text should include additional clarification so that the users are aware of how it works starting from version 2.6

When possible, the distinct command uses an index to find documents and return values.

Please replace it with something like the following in order to reflect how an index may be chosen chosen.

When convenient to use covered indexes, the db.collection.distinct() method will use an index to find the documents in the query as well as to return the results. A covered will only be used when the index is prefixed by the field in the distinct method. Although there are some cases where a compound index with the distinct field not in the prefix may be a suitable a covered index query, MongoDB cannot reliably determine suitability, so will instead use the underlying documents. In earlier versions, MongoDB would attempt to use any index containing the distinct field.


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