[SERVER-14496] Add limit parameter to $or operator to provide control of the number of queries that will be executed in parallel Created: 08/Jul/14  Updated: 09/Jul/16  Resolved: 14/Jul/14

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Eoin Brazil Assignee: Ramon Fernandez Marina
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DOCS-3731 Clarify that parallel processing not ... Closed
Participants:

 Description   

Decide whether or not this is necessary and if it is then implement.

The current $or operator behaviour executes all clauses of an $or in parallel. The default behaviour should remain unchanged, however is it possible to add a control to limit the number of parallel queries (individual $or clauses executed) launched. With a poorly designed query this can cause performance issues at the mongod level and at a sharded level can trigger timeouts from the mongos processes.



 Comments   
Comment by J Rassi [ 14/Jul/14 ]

It is a misconception that parallel processing is used to execute separate branches of $or queries simultaneously. DOCS-3731 has been filed to clarify the documentation. Logically, the query engine constructs the result set for an $or by generating the set of documents for each clause (in series) and computing the union of those sets. Adding clauses to an existing $or query does not affect the number of cores utilized for the query. Resolving as works-as-designed.

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