MySQL 9.1.0
Source Code Documentation
Cost_estimate Class Reference

Used to store optimizer cost estimates. More...

#include <handler.h>

Public Member Functions

 Cost_estimate ()
 
double total_cost () const
 Returns sum of time-consuming costs, i.e., not counting memory cost. More...
 
double get_io_cost () const
 
double get_cpu_cost () const
 
double get_import_cost () const
 
double get_mem_cost () const
 
bool is_zero () const
 Whether or not all costs in the object are zero. More...
 
bool is_max_cost () const
 Whether or not the total cost is the maximal double. More...
 
void reset ()
 Reset all costs to zero. More...
 
void set_max_cost ()
 Set current cost to the maximal double. More...
 
void multiply (double m)
 Multiply io, cpu and import costs by parameter. More...
 
Cost_estimateoperator+= (const Cost_estimate &other)
 
Cost_estimate operator+ (const Cost_estimate &other)
 
Cost_estimate operator- (const Cost_estimate &other)
 
bool operator> (const Cost_estimate &other) const
 
bool operator< (const Cost_estimate &other) const
 
void add_io (double add_io_cost)
 Add to IO cost. More...
 
void add_cpu (double add_cpu_cost)
 Add to CPU cost. More...
 
void add_import (double add_import_cost)
 Add to import cost. More...
 
void add_mem (double add_mem_cost)
 Add to memory cost. More...
 

Private Attributes

double io_cost
 cost of I/O operations More...
 
double cpu_cost
 cost of CPU operations More...
 
double import_cost
 cost of remote operations More...
 
double mem_cost
 memory used (bytes) More...
 

Detailed Description

Used to store optimizer cost estimates.

The class consists of PODs only: default operator=, copy constructor and destructor are used.

Constructor & Destructor Documentation

◆ Cost_estimate()

Cost_estimate::Cost_estimate ( )
inline

Member Function Documentation

◆ add_cpu()

void Cost_estimate::add_cpu ( double  add_cpu_cost)
inline

Add to CPU cost.

◆ add_import()

void Cost_estimate::add_import ( double  add_import_cost)
inline

Add to import cost.

◆ add_io()

void Cost_estimate::add_io ( double  add_io_cost)
inline

Add to IO cost.

◆ add_mem()

void Cost_estimate::add_mem ( double  add_mem_cost)
inline

Add to memory cost.

◆ get_cpu_cost()

double Cost_estimate::get_cpu_cost ( ) const
inline

◆ get_import_cost()

double Cost_estimate::get_import_cost ( ) const
inline

◆ get_io_cost()

double Cost_estimate::get_io_cost ( ) const
inline

◆ get_mem_cost()

double Cost_estimate::get_mem_cost ( ) const
inline

◆ is_max_cost()

bool Cost_estimate::is_max_cost ( ) const
inline

Whether or not the total cost is the maximal double.

Returns
true if total cost is the maximal double, false otherwise

◆ is_zero()

bool Cost_estimate::is_zero ( ) const
inline

Whether or not all costs in the object are zero.

Returns
true if all costs are zero, false otherwise

◆ multiply()

void Cost_estimate::multiply ( double  m)
inline

Multiply io, cpu and import costs by parameter.

◆ operator+()

Cost_estimate Cost_estimate::operator+ ( const Cost_estimate other)
inline

◆ operator+=()

Cost_estimate & Cost_estimate::operator+= ( const Cost_estimate other)
inline

◆ operator-()

Cost_estimate Cost_estimate::operator- ( const Cost_estimate other)
inline

◆ operator<()

bool Cost_estimate::operator< ( const Cost_estimate other) const
inline

◆ operator>()

bool Cost_estimate::operator> ( const Cost_estimate other) const
inline

◆ reset()

void Cost_estimate::reset ( )
inline

Reset all costs to zero.

◆ set_max_cost()

void Cost_estimate::set_max_cost ( )
inline

Set current cost to the maximal double.

◆ total_cost()

double Cost_estimate::total_cost ( ) const
inline

Returns sum of time-consuming costs, i.e., not counting memory cost.

Member Data Documentation

◆ cpu_cost

double Cost_estimate::cpu_cost
private

cost of CPU operations

◆ import_cost

double Cost_estimate::import_cost
private

cost of remote operations

◆ io_cost

double Cost_estimate::io_cost
private

cost of I/O operations

◆ mem_cost

double Cost_estimate::mem_cost
private

memory used (bytes)


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