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.
- related to
-
SERVER-69447 Add a query knob to control version of Cost Model coefficients
- Closed