Cost constants for a storage engine.
More...
#include <opt_costconstants.h>
Cost constants for a storage engine.
Storage engines that want to add new cost constants should make a subclass of this class.
◆ SE_cost_constants()
SE_cost_constants::SE_cost_constants |
( |
Optimizer |
optimizer | ) |
|
|
inline |
Creates a storage engine cost constants object with default values.
The default values for the cost constants are specified here.
- Parameters
-
optimizer | The type of optimizer to construct cost constants for. |
- Note
- The default cost constants are displayed in the default_value column of the mysql.engine_cost cost table. If any default value is changed, make sure to update the column definitions in mysql_system_tables.sql and mysql_system_tables_fix.sql.
◆ ~SE_cost_constants()
virtual SE_cost_constants::~SE_cost_constants |
( |
| ) |
|
|
virtualdefault |
◆ io_block_read_cost()
double SE_cost_constants::io_block_read_cost |
( |
| ) |
const |
|
inline |
Cost of reading one random block from disk.
◆ memory_block_read_cost()
double SE_cost_constants::memory_block_read_cost |
( |
| ) |
const |
|
inline |
Cost of reading one random block from an in-memory database buffer.
◆ set()
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.
- Parameters
-
name | name of cost constant |
value | new value |
default_value | specify whether the new value is a default value or an engine specific value |
- Returns
- Status for updating the cost constant
◆ update()
Update the value of a cost constant.
- Parameters
-
name | name of the cost constant |
value | the new value this cost constant should take |
- Returns
- Status for updating the cost constant
◆ update_cost_value()
void SE_cost_constants::update_cost_value |
( |
double * |
cost_constant, |
|
|
bool * |
cost_constant_is_default, |
|
|
double |
new_value, |
|
|
bool |
new_value_is_default |
|
) |
| |
|
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
- Parameters
-
[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 |
◆ update_default()
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.
- Parameters
-
name | name of the cost constant |
value | the new value this cost constant should take |
- Returns
- Status for updating the cost constant
◆ Cost_model_constants
◆ m_io_block_read_cost
double SE_cost_constants::m_io_block_read_cost |
|
private |
Cost constant for reading a random disk block.
◆ m_io_block_read_cost_default
bool SE_cost_constants::m_io_block_read_cost_default |
|
private |
Whether the io_block_read_cost is a default value or not.
◆ m_memory_block_read_cost
double SE_cost_constants::m_memory_block_read_cost |
|
private |
Cost constant for reading a random block from an in-memory buffer.
◆ m_memory_block_read_cost_default
bool SE_cost_constants::m_memory_block_read_cost_default |
|
private |
Whether the memory_block_read_cost is a default value or not.
The documentation for this class was generated from the following files: