MySQL 9.1.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 Types

enum class  ProposeResult { kNoPathFound , kPathsFound , kError }
 Return value of ProposePath(). More...
 

Public Member Functions

RefAccessBuilderset_receiver (CostingReceiver *val)
 
RefAccessBuilderset_table (TABLE *val)
 
RefAccessBuilderset_node_idx (int val)
 
RefAccessBuilderset_key_idx (unsigned val)
 
RefAccessBuilderset_force_num_output_rows_after_filter (double val)
 
RefAccessBuilderset_reverse (bool val)
 
RefAccessBuilderset_allowed_parameter_tables (table_map val)
 
RefAccessBuilderset_ordering_idx (int val)
 
ProposeResult ProposePath () const
 Popose an AccessPath if we found a suitable match betweeen the key and the sargable predicates. More...
 

Private Member Functions

THDthd () const
 
JoinHypergraphgraph () const
 
KeyMatch FindKeyMatch () const
 Go through each of the sargable predicates and see how many key parts we can match. More...
 
std::optional< LookupBuildLookup (const KeyMatch &key_match) const
 Create Index_lookup for this ref, and set it up based on the chosen keyparts. More...
 
std::optional< PredicateAnalysisAnalyzePredicates (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

CostingReceiverm_receiver
 The receiver for the current Query_block. More...
 
TABLEm_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...
 

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 Enumeration Documentation

◆ ProposeResult

enum class anonymous_namespace{join_optimizer.cc}::RefAccessBuilder::ProposeResult
strong

Return value of ProposePath().

Enumerator
kNoPathFound 

No path was proposed.

kPathsFound 

One or more paths were proposed.

kError 

There was an error.

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()

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

Popose 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_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_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: