[DOCS-15083] Indexing $exists Created: 02/Feb/22  Updated: 30/Oct/23  Due: 29/Apr/22  Resolved: 29/Apr/22

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

Type: Improvement Priority: Minor - P4
Reporter: Ronan Merrick Assignee: Joseph Dougherty
Resolution: Fixed Votes: 0
Labels: Onboarding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 40 weeks, 5 days ago
Epic Link: DOCSP-11702

 Description   

Due to SERVER-12869, normal indexes require a FETCH for exists:false and exists:true queries.

We have a section in our documentation on Using sparse indexes to improve exists performance

As SERVER-12869 has been open since 2014, would it make sense to expand the discussion of indexing exists to include the implications of that ticket:

We can safely use an index on $exists queries in the following cases:
{a:{ $exists:true }} - normal index helps, but we must still fetch
{a:{ $exists:true }} - sparse index is exact
{a:{ $exists:false }} - normal index requires a fetch
{a:{ $exists:false }} - never 

Based on customer feedback, this was not clear from the documentation.



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

Author:

{'name': 'jmd-mongo', 'email': '73852296+jmd-mongo@users.noreply.github.com', 'username': 'jmd-mongo'}

Message: DOCS-15083 clarifies how sparse/non-sparse indexes affect exists queries (#1016)

  • clarifies how sparse/non-sparse indexes affect exists queries
  • combine into one paragraph
  • review feedback
Generated at Thu Feb 08 08:11:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.