MySQL 8.4.3
Source Code Documentation
Server_cost_constants Class Reference

Cost constants for operations done by the server. More...

#include <opt_costconstants.h>

Public Member Functions

 Server_cost_constants (Optimizer optimizer)
 Creates a server cost constants object with default values. More...
 
double row_evaluate_cost () const
 Cost for evaluating the query condition on a row. More...
 
double key_compare_cost () const
 Cost for comparing two keys. More...
 
double memory_temptable_create_cost () const
 Cost for creating an internal temporary table in memory. More...
 
double memory_temptable_row_cost () const
 Cost for retrieving or storing a row in an internal temporary table stored in memory. More...
 
double disk_temptable_create_cost () const
 Cost for creating an internal temporary table in a disk resident storage engine. More...
 
double disk_temptable_row_cost () const
 Cost for retrieving or storing a row in an internal disk resident temporary table. More...
 
cost_constant_error set (const LEX_CSTRING &name, const double value)
 Set the value of one of the cost constants. More...
 

Private Attributes

double m_row_evaluate_cost
 Cost for evaluating the query condition on a row. More...
 
double m_key_compare_cost
 Cost for comparing two keys. More...
 
double m_memory_temptable_create_cost
 Cost for creating an internal temporary table in memory. More...
 
double m_memory_temptable_row_cost
 Cost for retrieving or storing a row in an internal temporary table stored in memory. More...
 
double m_disk_temptable_create_cost
 Cost for creating an internal temporary table in a disk resident storage engine. More...
 
double m_disk_temptable_row_cost
 Cost for retrieving or storing a row in an internal disk resident temporary table. More...
 

Detailed Description

Cost constants for operations done by the server.

Constructor & Destructor Documentation

◆ Server_cost_constants()

Server_cost_constants::Server_cost_constants ( Optimizer  optimizer)
inline

Creates a server cost constants object with default values.

The default values of the cost constants are specified here.

Parameters
optimizerThe type of optimizer to construct cost constants for.
Note
The default cost constants are displayed in the default_value column of the mysql.server_cost tables. If any default value is changed, make sure to update the column definitions in mysql_system_tables.sql and mysql_system_tables_fix.sql.

Member Function Documentation

◆ disk_temptable_create_cost()

double Server_cost_constants::disk_temptable_create_cost ( ) const
inline

Cost for creating an internal temporary table in a disk resident storage engine.

◆ disk_temptable_row_cost()

double Server_cost_constants::disk_temptable_row_cost ( ) const
inline

Cost for retrieving or storing a row in an internal disk resident temporary table.

◆ key_compare_cost()

double Server_cost_constants::key_compare_cost ( ) const
inline

Cost for comparing two keys.

◆ memory_temptable_create_cost()

double Server_cost_constants::memory_temptable_create_cost ( ) const
inline

Cost for creating an internal temporary table in memory.

◆ memory_temptable_row_cost()

double Server_cost_constants::memory_temptable_row_cost ( ) const
inline

Cost for retrieving or storing a row in an internal temporary table stored in memory.

◆ row_evaluate_cost()

double Server_cost_constants::row_evaluate_cost ( ) const
inline

Cost for evaluating the query condition on a row.

◆ set()

cost_constant_error Server_cost_constants::set ( const LEX_CSTRING name,
const double  value 
)

Set the value of one of the cost constants.

Parameters
namename of cost constant
valuenew value
Returns
Status for updating the cost constant

Member Data Documentation

◆ m_disk_temptable_create_cost

double Server_cost_constants::m_disk_temptable_create_cost
private

Cost for creating an internal temporary table in a disk resident storage engine.

Note
Creating a MyISAM table is 20 times slower than creating a Memory table.

◆ m_disk_temptable_row_cost

double Server_cost_constants::m_disk_temptable_row_cost
private

Cost for retrieving or storing a row in an internal disk resident temporary table.

Note
Generating MyISAM rows sequentially is 2 times slower than generating Memory rows, when number of rows is greater than 1000. However, we do not have benchmarks for very large tables, so setting this factor conservatively to be 5 times slower (ie the cost is 1.0).

◆ m_key_compare_cost

double Server_cost_constants::m_key_compare_cost
private

Cost for comparing two keys.

◆ m_memory_temptable_create_cost

double Server_cost_constants::m_memory_temptable_create_cost
private

Cost for creating an internal temporary table in memory.

Note
Creating a Memory temporary table is by benchmark found to be as costly as writing 10 rows into the table.

◆ m_memory_temptable_row_cost

double Server_cost_constants::m_memory_temptable_row_cost
private

Cost for retrieving or storing a row in an internal temporary table stored in memory.

Note
Writing a row to or reading a row from a Memory temporary table is equivalent to evaluating a row in the join engine.

◆ m_row_evaluate_cost

double Server_cost_constants::m_row_evaluate_cost
private

Cost for evaluating the query condition on a row.


The documentation for this class was generated from the following files: