MySQL 9.1.0
Source Code Documentation
|
Set of all cost constants used by the server and all storage engines. More...
#include <opt_costconstants.h>
Public Member Functions | |
Cost_model_constants (Optimizer optimizer) | |
Creates a set with cost constants using the default values defined in the source code. More... | |
virtual | ~Cost_model_constants () |
Destructor. More... | |
const Server_cost_constants * | get_server_cost_constants () const |
Get the cost constants that should be used for server operations. More... | |
const SE_cost_constants * | get_se_cost_constants (const TABLE *table) const |
Return the cost constants that should be used for a given table. More... | |
cost_constant_error | update_server_cost_constant (const LEX_CSTRING &name, double value) |
Update the value for one of the server cost constants. More... | |
cost_constant_error | update_engine_cost_constant (THD *thd, const LEX_CSTRING &se_name, uint storage_category, const LEX_CSTRING &name, double value) |
Update the value for one of the storage engine cost constants. More... | |
Protected Member Functions | |
void | inc_ref_count () |
Increment the reference counter for this cost constant set. More... | |
unsigned int | dec_ref_count () |
Decrement the reference counter for this cost constant set. More... | |
Private Member Functions | |
virtual uint | find_handler_slot_from_name (THD *thd, const LEX_CSTRING &name) const |
Utility function for finding the slot number for a storage engine based on the storage engine name. More... | |
cost_constant_error | update_engine_default_cost (const LEX_CSTRING &name, uint storage_category, double value) |
Update the default value for a storage engine cost constant. More... | |
Private Attributes | |
Server_cost_constants | m_server_constants |
Cost constants for server operations. More... | |
Prealloced_array< Cost_model_se_info, 15 > | m_engines |
Cost constants for storage engines 15 should be enough for most use cases, see PREALLOC_NUM_HA. More... | |
unsigned int | m_ref_counter |
Reference counter for this set of cost constants. More... | |
Optimizer | m_optimizer |
Optimizer type. More... | |
Friends | |
class | Cost_constant_cache |
Set of all cost constants used by the server and all storage engines.
Cost_model_constants::Cost_model_constants | ( | Optimizer | optimizer | ) |
Creates a set with cost constants using the default values defined in the source code.
Create default cost constants for each storage engine.
|
virtual |
Destructor.
|
inlineprotected |
Decrement the reference counter for this cost constant set.
When the returned value is zero, there is nobody using this object and it can be deleted by the caller.
|
privatevirtual |
Utility function for finding the slot number for a storage engine based on the storage engine name.
The only reason for making this function virtual is to be able to override it in unit tests.
thd | the THD |
name | name of storage engine |
const SE_cost_constants * Cost_model_constants::get_se_cost_constants | ( | const TABLE * | table | ) | const |
Return the cost constants that should be used for a given table.
table | the table to find cost constants for |
|
inline |
Get the cost constants that should be used for server operations.
|
inlineprotected |
Increment the reference counter for this cost constant set.
cost_constant_error Cost_model_constants::update_engine_cost_constant | ( | THD * | thd, |
const LEX_CSTRING & | se_name, | ||
uint | storage_category, | ||
const LEX_CSTRING & | name, | ||
double | value | ||
) |
Update the value for one of the storage engine cost constants.
thd | the THD |
se_name | name of storage engine |
storage_category | storage device type |
name | name of cost constant |
value | new value |
|
private |
Update the default value for a storage engine cost constant.
name | name of cost constant |
storage_category | storage device type |
value | new value |
cost_constant_error Cost_model_constants::update_server_cost_constant | ( | const LEX_CSTRING & | name, |
double | value | ||
) |
Update the value for one of the server cost constants.
name | name of the cost constant |
value | new value |
|
friend |
|
private |
Cost constants for storage engines 15 should be enough for most use cases, see PREALLOC_NUM_HA.
|
private |
Optimizer type.
|
private |
Reference counter for this set of cost constants.
|
private |
Cost constants for server operations.