MySQL 8.0.39
Source Code Documentation
|
This class finds disjoint sets of aggregation terms that form prefixes of some non-hash index, and makes row estimates for those sets based on index metadata. More...
Classes | |
struct | Prefix |
A prefix of some key where each key_part corresponds to an aggregation term. More... | |
Public Member Functions | |
AggregateRowEstimator (const TermArray &terms, string *trace) | |
AggregateRowEstimator (const AggregateRowEstimator &)=delete | |
AggregateRowEstimator & | operator= (const AggregateRowEstimator &)=delete |
double | MakeNextEstimate () |
Get the next row estimate. More... | |
const MutableOverflowBitset & | GetConsumedTerms () const |
Get the set of terms for which we have found an index. More... | |
Static Public Attributes | |
static constexpr double | kNoEstimate = -1.0 |
Used to indicate that no more suitable indexes could be found. More... | |
Private Member Functions | |
TermArray::const_iterator | FindField (const Field *field) const |
Find an Item_field pointing to 'field' in 'm_terms', if there is one. More... | |
Private Attributes | |
const TermArray * | m_terms |
The aggregation terms. More... | |
MutableOverflowBitset | m_consumed_terms |
The set of terms mapped to an index so far. More... | |
Mem_root_array< Prefix * > | m_prefixes {current_thd->mem_root} |
The index prefixes we found for 'm_terms'. More... | |
string * | m_trace |
Optimizer trace text. More... | |
This class finds disjoint sets of aggregation terms that form prefixes of some non-hash index, and makes row estimates for those sets based on index metadata.
anonymous_namespace{cost_model.cc}::AggregateRowEstimator::AggregateRowEstimator | ( | const TermArray & | terms, |
string * | trace | ||
) |
terms | The aggregation terms. |
trace | Append optimizer trace text to this if non-null. |
|
delete |
|
inlineprivate |
Find an Item_field pointing to 'field' in 'm_terms', if there is one.
field | The field we look for. |
|
inline |
Get the set of terms for which we have found an index.
Bit number corresponds to position in the 'terms' argument to the constructor.
double anonymous_namespace{cost_model.cc}::AggregateRowEstimator::MakeNextEstimate | ( | ) |
Get the next row estimate.
We make the estimate as follows:
|
delete |
|
staticconstexpr |
Used to indicate that no more suitable indexes could be found.
|
private |
The set of terms mapped to an index so far.
|
private |
The index prefixes we found for 'm_terms'.
|
private |
The aggregation terms.
|
private |
Optimizer trace text.