MySQL 8.0.40
Source Code Documentation
|
Cost constants for a storage engine. More...
#include <opt_costconstants.h>
Public Member Functions | |
SE_cost_constants () | |
virtual | ~SE_cost_constants ()=default |
double | memory_block_read_cost () const |
Cost of reading one random block from an in-memory database buffer. More... | |
double | io_block_read_cost () const |
Cost of reading one random block from disk. More... | |
Protected Member Functions | |
virtual cost_constant_error | set (const LEX_CSTRING &name, const double value, bool default_value) |
Set the value of one of the cost constants. More... | |
cost_constant_error | update (const LEX_CSTRING &name, const double value) |
Update the value of a cost constant. More... | |
cost_constant_error | update_default (const LEX_CSTRING &name, const double value) |
Update the default value of a cost constant. More... | |
void | update_cost_value (double *cost_constant, bool *cost_constant_is_default, double new_value, bool new_value_is_default) |
Utility function for changing the value of a cost constant. More... | |
Private Attributes | |
double | m_memory_block_read_cost |
Cost constant for reading a random block from an in-memory buffer. More... | |
double | m_io_block_read_cost |
Cost constant for reading a random disk block. More... | |
bool | m_memory_block_read_cost_default |
Whether the memory_block_read_cost is a default value or not. More... | |
bool | m_io_block_read_cost_default |
Whether the io_block_read_cost is a default value or not. More... | |
Static Private Attributes | |
static const double | MEMORY_BLOCK_READ_COST = 0.25 |
Default cost for reading a random block from an in-memory buffer. More... | |
static const double | IO_BLOCK_READ_COST = 1.0 |
Default cost for reading a random disk block. More... | |
Friends | |
class | Cost_model_constants |
Cost constants for a storage engine.
Storage engines that want to add new cost constants should make a subclass of this class.
|
inline |
|
virtualdefault |
|
inline |
Cost of reading one random block from disk.
|
inline |
Cost of reading one random block from an in-memory database buffer.
|
protectedvirtual |
Set the value of one of the cost constants.
If a storage engine wants to introduce a new cost constant, it should provide an implementation of this function. If the cost constant is not recognized by the function in the subclass, then this function should be called to allow the cost constant in the base class to be given the updated value.
name | name of cost constant |
value | new value |
default_value | specify whether the new value is a default value or an engine specific value |
|
protected |
Update the value of a cost constant.
name | name of the cost constant |
value | the new value this cost constant should take |
|
protected |
Utility function for changing the value of a cost constant.
The cost constant will be updated to the new value iff: a) the current value is the default value, or b) the current value is not the default value and the new value is not a default value
[out] | cost_constant | pointer to the cost constant that should be updated |
[in,out] | cost_constant_is_default | whether the current value has the default value or not |
new_value | the new value for the cost constant | |
new_value_is_default | whether this is a new default value or not |
|
protected |
Update the default value of a cost constant.
If this const constant already has been given a non-default value, then calling this will have no effect on the current value for the cost constant.
name | name of the cost constant |
value | the new value this cost constant should take |
|
friend |
|
staticprivate |
Default cost for reading a random disk block.
|
private |
Cost constant for reading a random disk block.
|
private |
Whether the io_block_read_cost is a default value or not.
|
private |
Cost constant for reading a random block from an in-memory buffer.
|
private |
Whether the memory_block_read_cost is a default value or not.
|
staticprivate |
Default cost for reading a random block from an in-memory buffer.