API for getting cost estimates for operations on table data.
More...
#include <opt_costmodel.h>
API for getting cost estimates for operations on table data.
- Note
- The initial implementation mostly has functions for accessing cost constants for basic operations.
◆ Cost_model_table()
Cost_model_table::Cost_model_table |
( |
| ) |
|
|
inline |
◆ buffer_block_read_cost()
double Cost_model_table::buffer_block_read_cost |
( |
double |
blocks | ) |
const |
|
inline |
Cost of reading a number of blocks from the storage engine when the block is already in a memory buffer.
- Parameters
-
blocks | number of blocks to read |
- Returns
- Cost estimate
◆ disk_seek_base_cost()
double Cost_model_table::disk_seek_base_cost |
( |
| ) |
const |
|
inline |
The fixed part of the cost for doing a sequential seek on disk.
For a harddisk, this corresponds to half a rotation (see comment for get_sweep_read_cost() in handler.cc).
◆ disk_seek_cost()
double Cost_model_table::disk_seek_cost |
( |
double |
seek_blocks | ) |
const |
|
inline |
Cost estimate for a sequential disk seek where a given number of blocks are skipped.
- Parameters
-
seek_blocks | number of blocks to seek past |
- Returns
- The cost estimate for the seek operation
◆ disk_seek_prop_cost()
double Cost_model_table::disk_seek_prop_cost |
( |
| ) |
const |
|
inlineprivate |
The cost for seeking past one block in a sequential seek.
For a harddisk, this represents the cost of having to move the disk head to the correct cylinder.
◆ init()
Initializes the cost model object.
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.
- Parameters
-
cost_model_server | the main cost model object for this query |
table | the table the cost model should be used for |
◆ io_block_read_cost()
double Cost_model_table::io_block_read_cost |
( |
double |
blocks | ) |
const |
|
inline |
Cost of reading a number of random blocks from a table.
- Parameters
-
blocks | number of blocks to read |
- Returns
- Cost estimate
◆ key_compare_cost()
double Cost_model_table::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
◆ page_read_cost()
double Cost_model_table::page_read_cost |
( |
double |
pages | ) |
const |
Cost of reading a number of random pages from a table.
- Parameters
-
pages | number of pages to read |
- Returns
- Cost estimate
◆ page_read_cost_index()
double Cost_model_table::page_read_cost_index |
( |
uint |
index, |
|
|
double |
pages |
|
) |
| const |
Cost of reading a number of random pages from an index.
- Parameters
-
index | the index number |
pages | number of pages to read |
- Returns
- Cost estimate
◆ row_evaluate_cost()
double Cost_model_table::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
◆ m_cost_model_server
Pointer to the cost model for the query.
This is used for getting cost estimates for server operations.
◆ m_initialized
bool Cost_model_table::m_initialized |
|
protected |
Used for detecting if this object is used without having been initialized.
◆ m_se_cost_constants
Cost constants for the storage engine that stores the table.
◆ m_table
const TABLE* Cost_model_table::m_table |
|
private |
The table that this is the cost model for.
The documentation for this class was generated from the following files: