MySQL 8.0.40
Source Code Documentation
make_join_hypergraph.h File Reference

Go to the source code of this file.

Classes

struct  SargablePredicate
 A sargable (from “Search ARGument”) predicate is one that we can attempt to push down into an index (what we'd call “ref access” or “index range scan”/“quick”). More...
 
struct  JoinHypergraph
 A struct containing a join hypergraph of a single query block, encapsulating the constraints given by the relational expressions (e.g. More...
 
struct  JoinHypergraph::Node
 

Functions

bool MakeJoinHypergraph (THD *thd, std::string *trace, JoinHypergraph *graph, bool *where_is_always_false)
 Make a join hypergraph from the query block given by “graph->query_block”, converting from MySQL's join list structures to the ones expected by the hypergraph join optimizer. More...
 
void MakeJoinGraphFromRelationalExpression (THD *thd, RelationalExpression *expr, std::string *trace, JoinHypergraph *graph)
 
hypergraph::NodeMap GetNodeMapFromTableMap (table_map table_map, const std::array< int, MAX_TABLES > &table_num_to_node_num)
 
std::string PrintDottyHypergraph (const JoinHypergraph &graph)
 For the given hypergraph, make a textual representation in the form of a dotty graph. More...
 
size_t EstimateHashJoinKeyWidth (const RelationalExpression *expr)
 Estimates the size of the hash join keys generated from the equi-join predicates in "expr". More...
 
table_map GetVisibleTables (const RelationalExpression *expr)
 

Function Documentation

◆ EstimateHashJoinKeyWidth()

size_t EstimateHashJoinKeyWidth ( const RelationalExpression expr)

Estimates the size of the hash join keys generated from the equi-join predicates in "expr".

◆ GetNodeMapFromTableMap()

hypergraph::NodeMap GetNodeMapFromTableMap ( table_map  table_map,
const std::array< int, MAX_TABLES > &  table_num_to_node_num 
)

◆ GetVisibleTables()

table_map GetVisibleTables ( const RelationalExpression expr)

◆ MakeJoinGraphFromRelationalExpression()

void MakeJoinGraphFromRelationalExpression ( THD thd,
RelationalExpression expr,
std::string *  trace,
JoinHypergraph graph 
)

◆ MakeJoinHypergraph()

bool MakeJoinHypergraph ( THD thd,
std::string *  trace,
JoinHypergraph graph,
bool *  where_is_always_false 
)

Make a join hypergraph from the query block given by “graph->query_block”, converting from MySQL's join list structures to the ones expected by the hypergraph join optimizer.

This includes pushdown of WHERE predicates, and detection of conditions suitable for hash join. However, it does not include simplification of outer to inner joins; that is presumed to have happened earlier.

The result is suitable for running DPhyp (subgraph_enumeration.h) to find optimal join planning.

◆ PrintDottyHypergraph()

std::string PrintDottyHypergraph ( const JoinHypergraph graph)

For the given hypergraph, make a textual representation in the form of a dotty graph.

You can save this to a file and then use Graphviz to render this it a graphical representation of the hypergraph for easier debugging, e.g. like this:

dot -Tps graph.dot > graph.ps display graph.ps

See also Dbug_table_list_dumper.