[DOCS-11790] [SERVER] Adding Equality-Sort-Range info to index documentation Created: 11/Jun/18  Updated: 30/Oct/23  Resolved: 14/Apr/22

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: Harshad Dhavale Assignee: Dave Cuthbert (Inactive)
Resolution: Fixed Votes: 6
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 43 weeks ago
Epic Link: DOCSP-1769

 Description   

Currently, our documentation does not have information that specifically talks about designing indexes using the Equality-Sort-Range rule. The online trainings talk about the E-S-R rule in depth, however the docs do not mention it.

It would be nice to add a blurb like this one, to our index documentation:

The optimal index for a given query can usually be found with the equality-sort-range rule, which 
indicates that in an index, the equality fields should be first, then the sort fields, and finally the range
fields.
So, for example, let's consider this query: db.test.find({a:'x', b: {$gt: 10}}).sort(}}{{{c:1}}}
Here, `a` is an equality based match, `b` is a range based match, and `c` is used for sorting. Following 
the equality-sort-range rule, the most optimal index for the above query will be: `{a:1, c:1, b:1}`

Scope of Changes

  • A new page or section possibly under Indexing Strategies to cover ESR
  • Need to frame carefully as a guideline and not an all-encompassing rule


 Comments   
Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Dave', 'email': '69165704+davemungo@users.noreply.github.com', 'username': 'davemungo'}

Message: DOCS-11790 equality sort range v5.3 (#908) (#948)
Branch: v4.2
https://github.com/10gen/docs-mongodb-internal/commit/8d9f70d01fc6db4e3d16b770084d00c80048c790

Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Dave', 'email': '69165704+davemungo@users.noreply.github.com', 'username': 'davemungo'}

Message: DOCS-11790 equality sort range v5.3 (#908) (#949)

  • Review feedback
  • Review feedback
  • Review feedback
  • Review feedback
Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Dave', 'email': '69165704+davemungo@users.noreply.github.com', 'username': 'davemungo'}

Message: DOCS-11790 equality sort range v5.3 (#908) (#950)

  • Review feedback
  • Review feedback
  • Review feedback
  • Review feedback
Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Dave', 'email': '69165704+davemungo@users.noreply.github.com', 'username': 'davemungo'}

Message: DOCS-11790 equality sort range v5.3 (#908)

  • Review feedback
  • Review feedback
  • Review feedback
  • Review feedback
Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Dave', 'email': '69165704+davemungo@users.noreply.github.com', 'username': 'davemungo'}

Message: DOCS-11790 equality sort range v5.3 (#908)

  • Review feedback
  • Review feedback
  • Review feedback
  • Review feedback
Comment by Shubham Ranjan [ 10/Jun/20 ]

The blog was great. Thanks alex.bevilacqua

Comment by Kanika Singla (Inactive) [ 10/Jun/20 ]

Thanks alex.bevilacqua. This helps.

Comment by Shubham Ranjan [ 10/Jun/20 ]

Hi team,

Any update on this ? It would be really great to have this information in the doc. We needed to share it with one of our on-demand users but we couldn't find something in the docs.

Generated at Thu Feb 08 08:03:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.