[DOCS-14442] Warn about performance issues with $in Created: 11/May/21  Updated: 30/Oct/23  Resolved: 01/Mar/22

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

Type: Task Priority: Major - P3
Reporter: Nic Cottrell Assignee: Kenneth Dyer
Resolution: Fixed Votes: 0
Labels: docs-onboarding-candidate
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 49 weeks, 2 days ago
Epic Link: DOCSP-11702
Story Points: 2

 Description   

Description

Page: https://docs.mongodb.com/manual/reference/operator/query/in/

There can be some performance issues when passing hundreds or thousands of parameters as a $in array. We should note that this is an anti-pattern and may be solved via a schema redesign.

Also, we should recommend that an index exists with the field. In the example here,  indexes like {tags: 1} and {qty: 1} would be very beneficial. 

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 28/Feb/22 ]

Author:

{'name': 'Kenneth P. J. Dyer', 'email': '93145796+kennethdyer@users.noreply.github.com', 'username': 'kennethdyer'}

Message: DOCS-14442 $in operator performance limitation (#258) (#739)

Comment by Githook User [ 28/Feb/22 ]

Author:

{'name': 'Kenneth P. J. Dyer', 'email': '93145796+kennethdyer@users.noreply.github.com', 'username': 'kennethdyer'}

Message: DOCS-14442 $in operator performance limitation (#258) (#738)

Comment by Githook User [ 28/Feb/22 ]

Author:

{'name': 'Kenneth P. J. Dyer', 'email': '93145796+kennethdyer@users.noreply.github.com', 'username': 'kennethdyer'}

Message: DOCS-14442 $in operator performance limitation (#258) (#737)

Comment by Githook User [ 28/Feb/22 ]

Author:

{'name': 'Kenneth P. J. Dyer', 'email': '93145796+kennethdyer@users.noreply.github.com', 'username': 'kennethdyer'}

Message: DOCS-14442 $in operator performance limitation (#258) (#736)

Comment by Githook User [ 28/Feb/22 ]

Author:

{'name': 'Kenneth P. J. Dyer', 'email': '93145796+kennethdyer@users.noreply.github.com', 'username': 'kennethdyer'}

Message: Docs 14442 in operator limits v5.2 (#735)

  • DOCS-14442 $in operator performance limitation (#258)
Comment by Githook User [ 28/Feb/22 ]

Author:

{'name': 'Kenneth P. J. Dyer', 'email': '93145796+kennethdyer@users.noreply.github.com', 'username': 'kennethdyer'}

Message: DOCS-14442 $in operator performance limitation (#258)

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