1#ifndef OPT_COSTMODEL_INCLUDED
2#define OPT_COSTMODEL_INCLUDED
190 double write_rows,
double read_rows)
const {
192 assert(write_rows >= 0.0);
193 assert(read_rows >= 0.0);
305 assert(blocks >= 0.0);
321 assert(blocks >= 0.0);
386 assert(seek_blocks >= 0.0);
Set of all cost constants used by the server and all storage engines.
Definition: opt_costconstants.h:416
API for getting cost estimates for server operations that are not directly related to a table object.
Definition: opt_costmodel.h:51
double disk_tmptable_create_cost() const
Cost of creating a temporary table using a disk based storage engine.
Definition: opt_costmodel.h:137
enum_tmptable_type
Temporary table types that the cost model differentiate between.
Definition: opt_costmodel.h:56
@ DISK_TMPTABLE
Definition: opt_costmodel.h:56
@ MEMORY_TMPTABLE
Definition: opt_costmodel.h:56
void init()
Initialize the cost model object for a query.
Definition: opt_costmodel.cc:44
bool m_initialized
Used for detecting if this object is used without having been initialized.
Definition: opt_costmodel.h:228
double tmptable_create_cost(enum_tmptable_type tmptable_type) const
Cost estimate for creating a temporary table.
Definition: opt_costmodel.h:171
virtual ~Cost_model_server()
Destructor for Cost_model_server objects.
Definition: opt_costmodel.cc:35
Cost_model_server()
Definition: opt_costmodel.h:58
double key_compare_cost(double keys) const
Cost of doing a number of key compare operations.
Definition: opt_costmodel.h:109
double disk_tmptable_row_cost() const
Cost of storing or retrieving a row using a disk based storage engine.
Definition: opt_costmodel.h:145
double row_evaluate_cost(double rows) const
Cost of processing a number of records and evaluating the query condition on the records.
Definition: opt_costmodel.h:94
double memory_tmptable_create_cost() const
Cost of creating a temporary table in the memory storage engine.
Definition: opt_costmodel.h:121
double tmptable_readwrite_cost(enum_tmptable_type tmptable_type, double write_rows, double read_rows) const
Cost estimate for inserting and reading records from a temporary table.
Definition: opt_costmodel.h:189
const Server_cost_constants * m_server_cost_constants
Definition: opt_costmodel.h:222
double memory_tmptable_row_cost() const
Cost of storing or retrieving a row using the memory storage engine.
Definition: opt_costmodel.h:129
const Cost_model_constants * m_cost_constants
Cost constants to use in cost calculations.
Definition: opt_costmodel.h:214
const Cost_model_constants * get_cost_constants() const
Return a pointer to the object containing the current cost constants.
Definition: opt_costmodel.h:206
double tmptable_row_cost(enum_tmptable_type tmptable_type) const
Cost estimate for a row operation (insert, read) on a temporary table.
Definition: opt_costmodel.h:157
API for getting cost estimates for operations on table data.
Definition: opt_costmodel.h:239
const TABLE * m_table
The table that this is the cost model for.
Definition: opt_costmodel.h:415
double io_block_read_cost(double blocks) const
Cost of reading a number of random blocks from a table.
Definition: opt_costmodel.h:303
const Cost_model_server * m_cost_model_server
Pointer to the cost model for the query.
Definition: opt_costmodel.h:399
double buffer_block_read_cost(double blocks) const
Cost of reading a number of blocks from the storage engine when the block is already in a memory buff...
Definition: opt_costmodel.h:319
double page_read_cost(double pages) const
Cost of reading a number of random pages from a table.
Definition: opt_costmodel.cc:78
double page_read_cost_index(uint index, double pages) const
Cost of reading a number of random pages from an index.
Definition: opt_costmodel.cc:94
const SE_cost_constants * m_se_cost_constants
Cost constants for the storage engine that stores the table.
Definition: opt_costmodel.h:404
Cost_model_table()
Definition: opt_costmodel.h:241
double disk_seek_base_cost() const
The fixed part of the cost for doing a sequential seek on disk.
Definition: opt_costmodel.h:354
double row_evaluate_cost(double rows) const
Cost of processing a number of records and evaluating the query condition on the records.
Definition: opt_costmodel.h:273
void init(const Cost_model_server *cost_model_server, const TABLE *table)
Initializes the cost model object.
Definition: opt_costmodel.cc:60
bool m_initialized
Used for detecting if this object is used without having been initialized.
Definition: opt_costmodel.h:410
double disk_seek_cost(double seek_blocks) const
Cost estimate for a sequential disk seek where a given number of blocks are skipped.
Definition: opt_costmodel.h:385
double disk_seek_prop_cost() const
The cost for seeking past one block in a sequential seek.
Definition: opt_costmodel.h:371
double key_compare_cost(double keys) const
Cost of doing a number of key compare operations.
Definition: opt_costmodel.h:288
Cost constants for a storage engine.
Definition: opt_costconstants.h:196
double memory_block_read_cost() const
Cost of reading one random block from an in-memory database buffer.
Definition: opt_costconstants.h:210
double io_block_read_cost() const
Cost of reading one random block from disk.
Definition: opt_costconstants.h:216
Cost constants for operations done by the server.
Definition: opt_costconstants.h:63
double row_evaluate_cost() const
Cost for evaluating the query condition on a row.
Definition: opt_costconstants.h:80
double disk_temptable_row_cost() const
Cost for retrieving or storing a row in an internal disk resident temporary table.
Definition: opt_costconstants.h:114
double memory_temptable_create_cost() const
Cost for creating an internal temporary table in memory.
Definition: opt_costconstants.h:90
double memory_temptable_row_cost() const
Cost for retrieving or storing a row in an internal temporary table stored in memory.
Definition: opt_costconstants.h:98
double disk_temptable_create_cost() const
Cost for creating an internal temporary table in a disk resident storage engine.
Definition: opt_costconstants.h:106
double key_compare_cost() const
Cost for comparing two keys.
Definition: opt_costconstants.h:85
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
static uint keys
Definition: hp_test2.cc:48
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
constexpr const double DISK_SEEK_BASE_COST
Definition: opt_costmodel.h:40
constexpr const double DISK_SEEK_PROP_COST
Definition: opt_costmodel.h:42
constexpr const int BLOCKS_IN_AVG_SEEK
Definition: opt_costmodel.h:41