[SERVER-74893] Change default enumeration strategy for planning $or queries Created: 15/Mar/23  Updated: 09/Nov/23  Resolved: 24/Aug/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.2

Type: Improvement Priority: Major - P3
Reporter: Chris Harris Assignee: Ruoxin Xu
Resolution: Fixed Votes: 0
Labels: query-director-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-75369 Fix the overflow of total possible en... Closed
Related
related to SERVER-83091 $or query can trigger an infinite loo... Closed
related to SERVER-50291 Add query knob to enumerate $or child... Closed
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0
Sprint: QO 2023-05-15, QO 2023-05-29, QO 2023-06-12, QO 2023-06-26, QO 2023-07-10, QO 2023-07-24, QO 2023-08-07, QO 2023-08-21, QO 2023-09-04
Participants:

 Description   

SERVER-50291 introduced the internalQueryEnumerationPreferLockstepOrEnumeration parameter that modifies the order in which the plans are generated for 'contained $or' queries. This turns out to often be helpful in practice as:

  1. It is often the case that the query shapes are constructed in such a way that using the same index for all of the branches yields the optimal query plan.
  2. There is a modest limit on how many such plans we will generate (and therefore consider) during query planning.

This new(er) enumeration strategy is currently still off (false) by default. 

As there is not much evidence to support the idea that the current strategy is superior to the alternative, and there have been successful uses of the new enumeration strategy to improve query execution, we should update the default to be the new strategy beginning in the next major release. That is to say that internalQueryEnumerationPreferLockstepOrEnumeration should be true by default going forward.



 Comments   
Comment by Githook User [ 29/Aug/23 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-74893 Change default enumeration strategy for planning $or queries

(cherry picked from commit a1e4a56bc38fc9b1d2e34c46a84e91b6867c715f)
Branch: v7.0
https://github.com/mongodb/mongo/commit/54e47776a57048634aede07a809bbf5a6109c46f

Comment by Githook User [ 23/Aug/23 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-74893 Change default enumeration strategy for planning $or queries
Branch: master
https://github.com/mongodb/mongo/commit/a1e4a56bc38fc9b1d2e34c46a84e91b6867c715f

Generated at Thu Feb 08 06:28:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.