[SERVER-60068] Avoid calls to fillOutPlannerParams() unless a replan is triggered Created: 19/Sep/21  Updated: 29/Oct/23  Resolved: 24/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Anton Korshunov Assignee: Ruoxin Xu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-15185 [SERVER] SERVER-60068: Avoid calls to... Closed
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: QO 2021-11-29, QO 2021-12-13, QO 2021-12-27, QO 2022-01-10, QO 2022-01-24, QO 2022-02-07, QO 2022-02-21, QO 2022-03-07, QO 2022-03-21, QO 2022-04-04
Participants:
Linked BF Score: 135

 Description   

Currently we call fillOutPlannerParams() in the early stage of PrepareExecutionHelper::prepare() call. However, if we're about to recover the plan from the cache and not going to replan, this call is totally unnecessary as we're not going to call the the query planner. Given that this call is quite expensive, we should delay it until we know that we're going to replan.



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

Author:

{'name': 'Rui Liu', 'email': 'rui.liu@mongodb.com', 'username': 'lriuui0x0'}

Message: SERVER-60068 Fill out more secondary collection infos in SBE planners
Branch: master
https://github.com/mongodb/mongo/commit/a4bf738013610d7001e8ca29cca3abf906d40f26

Comment by Githook User [ 24/Mar/22 ]

Author:

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

Message: SERVER-60068 Fill out SecondaryCollectionsInformation for $lookup planning
Branch: master
https://github.com/mongodb/mongo/commit/4582d550ecc743c37fa7932861548df387a4627f

Comment by Ruoxin Xu [ 24/Mar/22 ]

In this ticket, we discovered a bug/inconsistency between find queries and distinct queries - distinct commands will always inherit collation from the collection if there’s no specified collation before the resolution of the index filters. Whereas find commands don’t do the same. This ticket fixed the bug by changing the behaviour of distinct command when working with index filters and collations. Prior to this ticket, it matters if distinct commands inherit the collation from the collection. After this ticket the resolution of index filters will only take into account the collations explicitly specified by the users no matter what the collection’s collation is. 

The behaviour above is not documented. There are some other related changes introduced by SERVER-23882 are also not documented. The changes about adding a new option ‘collation’ to index filter commands (planCacheClearFilters, planCacheSetFilter). 

Cc: christopher.harris anton.korshunov david.storch

Comment by Githook User [ 24/Mar/22 ]

Author:

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

Message: SERVER-60068 Avoid calls to fillOutPlannerParams() unless a replan is triggered
Branch: master
https://github.com/mongodb/mongo/commit/b04a26a200bc12154cfc08fe031f5d033655f1b9

Generated at Thu Feb 08 05:48:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.