MySQL 26.7.0
Source Code Documentation
anonymous_namespace{join_optimizer.cc}::RefAccessBuilder Class Referencefinal

A builder class for constructing REF (or EQ_REF) AccessPath objects. More...

Classes

struct  KeyMatch
 Result type for FindKeyMatch(). More...
 
struct  Lookup
 Result type for BuildLookup(). More...
 
struct  PredicateAnalysis
 Result type of AnalyzePredicates(). More...
 

Public Member Functions

RefAccessBuilder & set_receiver (CostingReceiver *val)
 
RefAccessBuilder & set_table (TABLE *val)
 
RefAccessBuilder & set_node_idx (int val)
 
RefAccessBuilder & set_key_idx (unsigned val)
 
RefAccessBuilder & set_force_num_output_rows_after_filter (double val)
 
RefAccessBuilder & set_reverse (bool val)
 
RefAccessBuilder & set_allowed_parameter_tables (table_map val)
 
RefAccessBuilder & set_ordering_idx (int val)
 
RefAccessBuilder & set_eq_ref_only (bool val)
 
ProposeResult ProposePath () const
 Propose an AccessPath if we found a suitable match betweeen the key and the sargable predicates. More...
 

Private Member Functions

THD * thd () const
 
JoinHypergraph * graph () const
 
KeyMatch FindKeyMatch () const
 Go through each of the sargable predicates and see how many key parts we can match. More...
 
std::optional< Lookup > BuildLookup (const KeyMatch &key_match) const
 Create Index_lookup for this ref, and set it up based on the chosen keyparts. More...
 
std::optional< PredicateAnalysis > AnalyzePredicates (const KeyMatch &key_match) const
 Find which predicates that are covered by this index access. More...
 
AccessPath MakePath (const KeyMatch &key_match, const Lookup &lookup, double num_output_rows) const
 Create the REF/EQ_REF access path. More...
 

Private Attributes

CostingReceiver * m_receiver
 The receiver for the current Query_block. More...
 
TABLE * m_table
 The table for which we want to create an AcessPath. More...
 
int m_node_idx
 The hypergraph node. More...
 
unsigned m_key_idx
 The key for the REF/EQ_REF AccessPath. More...
 
double m_force_num_output_rows_after_filter {kUnknownRowCount}
 A row estimate from the range optimizer (or kUnknownRowCount if there is none. More...
 
bool m_reverse {false}
 True if we wish to do a reverse scan. More...
 
table_map m_allowed_parameter_tables {0}
 The set of tables that we may use as parameters for the REF AccessPath. More...
 
int m_ordering_idx
 The output ordering of the AccessPath we propose. More...
 
bool m_eq_ref_only {false}
 True if we only want EQ_REF paths (no REFs). More...
 

Detailed Description

A builder class for constructing REF (or EQ_REF) AccessPath objects.

Doing so in a single function would give an excessively long function with an overly long parameter list.

Member Function Documentation

◆ AnalyzePredicates()

std::optional< RefAccessBuilder::PredicateAnalysis > anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::AnalyzePredicates ( const KeyMatch &  key_match) const
private

Find which predicates that are covered by this index access.

◆ BuildLookup()

std::optional< RefAccessBuilder::Lookup > anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::BuildLookup ( const KeyMatch &  key_match) const
private

Create Index_lookup for this ref, and set it up based on the chosen keyparts.

◆ FindKeyMatch()

RefAccessBuilder::KeyMatch anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::FindKeyMatch ( ) const
private

Go through each of the sargable predicates and see how many key parts we can match.

◆ graph()

JoinHypergraph * anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::graph ( ) const
inlineprivate

◆ MakePath()

AccessPath anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::MakePath ( const KeyMatch &  key_match,
const Lookup &  lookup,
double  num_output_rows 
) const
private

Create the REF/EQ_REF access path.

◆ ProposePath()

ProposeResult anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::ProposePath ( ) const

Propose an AccessPath if we found a suitable match betweeen the key and the sargable predicates.

◆ set_allowed_parameter_tables()

RefAccessBuilder & anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::set_allowed_parameter_tables ( table_map  val)
inline

◆ set_eq_ref_only()

RefAccessBuilder & anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::set_eq_ref_only ( bool  val)
inline

◆ set_force_num_output_rows_after_filter()

RefAccessBuilder & anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::set_force_num_output_rows_after_filter ( double  val)
inline

◆ set_key_idx()

RefAccessBuilder & anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::set_key_idx ( unsigned  val)
inline

◆ set_node_idx()

RefAccessBuilder & anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::set_node_idx ( int  val)
inline

◆ set_ordering_idx()

RefAccessBuilder & anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::set_ordering_idx ( int  val)
inline

◆ set_receiver()

RefAccessBuilder & anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::set_receiver ( CostingReceiver *  val)
inline

◆ set_reverse()

RefAccessBuilder & anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::set_reverse ( bool  val)
inline

◆ set_table()

RefAccessBuilder & anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::set_table ( TABLE *  val)
inline

◆ thd()

THD * anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::thd ( ) const
inlineprivate

Member Data Documentation

◆ m_allowed_parameter_tables

table_map anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::m_allowed_parameter_tables {0}
private

The set of tables that we may use as parameters for the REF AccessPath.

◆ m_eq_ref_only

bool anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::m_eq_ref_only {false}
private

True if we only want EQ_REF paths (no REFs).

◆ m_force_num_output_rows_after_filter

double anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::m_force_num_output_rows_after_filter {kUnknownRowCount}
private

A row estimate from the range optimizer (or kUnknownRowCount if there is none.

◆ m_key_idx

unsigned anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::m_key_idx
private

The key for the REF/EQ_REF AccessPath.

◆ m_node_idx

int anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::m_node_idx
private

The hypergraph node.

◆ m_ordering_idx

int anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::m_ordering_idx
private

The output ordering of the AccessPath we propose.

◆ m_receiver

CostingReceiver* anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::m_receiver
private

The receiver for the current Query_block.

◆ m_reverse

bool anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::m_reverse {false}
private

True if we wish to do a reverse scan.

◆ m_table

TABLE* anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::m_table
private

The table for which we want to create an AcessPath.


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