[SERVER-70490] Reconsider how we apply overrides for Cost Model Coefficients Created: 12/Oct/22  Updated: 29/Oct/23  Resolved: 11/Nov/22

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

Type: Task Priority: Major - P3
Reporter: Alexander Ignatyev Assignee: Ruoxin Xu
Resolution: Fixed Votes: 0
Labels: M5
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Related
related to SERVER-69447 Add a query knob to control version o... Closed
Backwards Compatibility: Fully Compatible
Sprint: QO 2022-11-14
Participants:
Linked BF Score: 164

 Description   

We parse the BSON object for every query we should to do only when the overrides are changed.

One possible solution it to use CostModelManager to cache overrides, every time the overrides are changed we can cache new coefficients in the CostModelManager object. We don't need to store coefficient for every overrides only for the last one since there is always just one active overrides object at any time.

We always apply overrides to the default coefficients, so we can always reset to the defaults just by setting overrides to an empty object, which should be mentioned in the comments and in the docs.



 Comments   
Comment by Githook User [ 23/Nov/22 ]

Author:

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

Message: SERVER-70490 Update cost model on Mongod startup
Branch: master
https://github.com/mongodb/mongo/commit/9114c3335f84c500eb767d06b7960eeff2802a56

Comment by Githook User [ 11/Nov/22 ]

Author:

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

Message: SERVER-70490 Cache cost model coefficients in CostModelManager
Branch: master
https://github.com/mongodb/mongo/commit/61f1123cb16ade2d55ec6460513170e4a270d30c

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