MySQL 8.0.40
Source Code Documentation
anonymous_namespace{explain_access_path.cc} Namespace Reference

Functions

int IntegerDigits (double d)
 Find the number of integer digits (i.e. More...
 
std::string DecimalFormat (double d, int log_precision)
 Format 'd' as a decimal number with enough decimals to get a rounding error less than d*10^log_precision, without any trailing fractional zeros. More...
 
std::string EngineeringFormat (double d)
 Format 'd' in engineering format, i.e. More...
 
std::string NumFormat (double d)
 Format 'd' for "EXPLAIN FORMAT=TREE" output. More...
 
constexpr uint64_t Power (uint64_t base, int power)
 Integer exponentiation. More...
 
std::string NumFormat (uint64_t l)
 Format 'l' for "EXPLAIN FORM=TREE" output. More...
 

Variables

constexpr int kPlainNumberLength = 6
 The maximal number of digits we use in decimal numbers (e.g. More...
 
constexpr int kMantissaLength = 3
 The maximal number of digits in engineering format mantissas, e.g. More...
 
constexpr double kMinNonZeroNumber = 1.0e-12
 The smallest number (absolute value) that we do not format as "0". More...
 
constexpr int kLogPrecision = -2
 For decimal numbers, include enough decimals to ensure that any rounding error is less than <number>*10^kLogPrecision (i.e. More...
 
const double kMinPlainFormatNumber
 The smallest number (absolute value) that we format as decimal (rather than engineering format). More...
 

Function Documentation

◆ DecimalFormat()

std::string anonymous_namespace{explain_access_path.cc}::DecimalFormat ( double  d,
int  log_precision 
)

Format 'd' as a decimal number with enough decimals to get a rounding error less than d*10^log_precision, without any trailing fractional zeros.

◆ EngineeringFormat()

std::string anonymous_namespace{explain_access_path.cc}::EngineeringFormat ( double  d)

Format 'd' in engineering format, i.e.

<mantissa>e<sign><exponent> where 1.0<=mantissa<1000.0 and exponent is a multiple of 3.

◆ IntegerDigits()

int anonymous_namespace{explain_access_path.cc}::IntegerDigits ( double  d)

Find the number of integer digits (i.e.

those before the decimal point) in 'd' when represented as a decimal number.

◆ NumFormat() [1/2]

std::string anonymous_namespace{explain_access_path.cc}::NumFormat ( double  d)

Format 'd' for "EXPLAIN FORMAT=TREE" output.

◆ NumFormat() [2/2]

std::string anonymous_namespace{explain_access_path.cc}::NumFormat ( uint64_t  l)

Format 'l' for "EXPLAIN FORM=TREE" output.

◆ Power()

constexpr uint64_t anonymous_namespace{explain_access_path.cc}::Power ( uint64_t  base,
int  power 
)
constexpr

Integer exponentiation.

Variable Documentation

◆ kLogPrecision

constexpr int anonymous_namespace{explain_access_path.cc}::kLogPrecision = -2
constexpr

For decimal numbers, include enough decimals to ensure that any rounding error is less than <number>*10^kLogPrecision (i.e.

less than 1%).

◆ kMantissaLength

constexpr int anonymous_namespace{explain_access_path.cc}::kMantissaLength = 3
constexpr

The maximal number of digits in engineering format mantissas, e.g.

"12.3e+6".

◆ kMinNonZeroNumber

constexpr double anonymous_namespace{explain_access_path.cc}::kMinNonZeroNumber = 1.0e-12
constexpr

The smallest number (absolute value) that we do not format as "0".

◆ kMinPlainFormatNumber

const double anonymous_namespace{explain_access_path.cc}::kMinPlainFormatNumber
Initial value:
=
std::pow(10, 1 - kPlainNumberLength - kLogPrecision)
constexpr int kLogPrecision
For decimal numbers, include enough decimals to ensure that any rounding error is less than <number>*...
Definition: explain_access_path.cc:1908
constexpr int kPlainNumberLength
The maximal number of digits we use in decimal numbers (e.g.
Definition: explain_access_path.cc:1897

The smallest number (absolute value) that we format as decimal (rather than engineering format).

◆ kPlainNumberLength

constexpr int anonymous_namespace{explain_access_path.cc}::kPlainNumberLength = 6
constexpr

The maximal number of digits we use in decimal numbers (e.g.

"123456" or "0.00123").