API for getting cost estimates for server operations that are not directly related to a table object.
More...
#include <opt_costmodel.h>
API for getting cost estimates for server operations that are not directly related to a table object.
◆ enum_tmptable_type
Temporary table types that the cost model differentiate between.
Enumerator |
---|
MEMORY_TMPTABLE | |
DISK_TMPTABLE | |
◆ Cost_model_server()
Cost_model_server::Cost_model_server |
( |
| ) |
|
|
inline |
◆ ~Cost_model_server()
Cost_model_server::~Cost_model_server |
( |
| ) |
|
|
virtual |
Destructor for Cost_model_server objects.
- Note
- This is declared virtual in order to make it easier to implement stubs for this class for use in unit tests.
◆ disk_tmptable_create_cost()
double Cost_model_server::disk_tmptable_create_cost |
( |
| ) |
const |
|
inlineprivate |
Cost of creating a temporary table using a disk based storage engine.
◆ disk_tmptable_row_cost()
double Cost_model_server::disk_tmptable_row_cost |
( |
| ) |
const |
|
inlineprivate |
Cost of storing or retrieving a row using a disk based storage engine.
◆ get_cost_constants()
Return a pointer to the object containing the current cost constants.
- Returns
- Cost constants
◆ init()
void Cost_model_server::init |
( |
| ) |
|
Initialize the cost model object for a query.
This function must be called before calling any cost estimation functions for a query. It should also be called when starting optimization of a new query in case any cost estimate constants have changed.
◆ key_compare_cost()
double Cost_model_server::key_compare_cost |
( |
double |
keys | ) |
const |
|
inline |
Cost of doing a number of key compare operations.
- Parameters
-
keys | number of key compare operations |
- Returns
- Cost of comparing the keys
◆ memory_tmptable_create_cost()
double Cost_model_server::memory_tmptable_create_cost |
( |
| ) |
const |
|
inlineprivate |
Cost of creating a temporary table in the memory storage engine.
◆ memory_tmptable_row_cost()
double Cost_model_server::memory_tmptable_row_cost |
( |
| ) |
const |
|
inlineprivate |
Cost of storing or retrieving a row using the memory storage engine.
◆ row_evaluate_cost()
double Cost_model_server::row_evaluate_cost |
( |
double |
rows | ) |
const |
|
inline |
Cost of processing a number of records and evaluating the query condition on the records.
- Parameters
-
rows | number of rows to evaluate |
- Returns
- Cost of evaluating the records
◆ tmptable_create_cost()
Cost estimate for creating a temporary table.
- Parameters
-
tmptable_type | storage type for the temporary table |
- Returns
- Cost estimate
◆ tmptable_readwrite_cost()
double Cost_model_server::tmptable_readwrite_cost |
( |
enum_tmptable_type |
tmptable_type, |
|
|
double |
write_rows, |
|
|
double |
read_rows |
|
) |
| const |
|
inline |
Cost estimate for inserting and reading records from a temporary table.
- Parameters
-
tmptable_type | storage type for the temporary table |
write_rows | number of rows that will be written to table |
read_rows | number of rows that will be read from table |
- Returns
- The estimated cost
◆ tmptable_row_cost()
Cost estimate for a row operation (insert, read) on a temporary table.
- Parameters
-
tmptable_type | storage type for the temporary table |
- Returns
- The estimated cost
◆ Cost_model_table
◆ m_cost_constants
Cost constants to use in cost calculations.
◆ m_initialized
bool Cost_model_server::m_initialized |
|
protected |
Used for detecting if this object is used without having been initialized.
◆ m_server_cost_constants
The documentation for this class was generated from the following files: