23#ifndef SQL_JOIN_OPTIMIZER_MAKE_JOIN_HYPERGRAPH
24#define SQL_JOIN_OPTIMIZER_MAKE_JOIN_HYPERGRAPH 1
175 const std::array<int, MAX_TABLES> &table_num_to_node_num);
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:802
Definition: sql_optimizer.h:125
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:421
Definition: overflow_bitset.h:76
This class represents a query block, aka a query specification, which is a query consisting of a SELE...
Definition: sql_lex.h:1124
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:945
std::unordered_map, but allocated on a MEM_ROOT.
Definition: map_helpers.h:280
static MEM_ROOT mem_root
Definition: client_plugin.cc:109
Definition of an undirected (join) hypergraph.
hypergraph::NodeMap GetNodeMapFromTableMap(table_map table_map, const std::array< int, MAX_TABLES > &table_num_to_node_num)
bool MakeJoinHypergraph(THD *thd, std::string *trace, JoinHypergraph *graph)
Make a join hypergraph from the query block given by “graph->query_block”, converting from MySQL's jo...
std::string PrintDottyHypergraph(const JoinHypergraph &graph)
For the given hypergraph, make a textual representation in the form of a dotty graph.
Definition: make_join_hypergraph.cc:2280
void MakeJoinGraphFromRelationalExpression(THD *thd, RelationalExpression *expr, std::string *trace, JoinHypergraph *graph)
uint64_t table_map
Definition: my_table_map.h:29
uint64_t NodeMap
Since our graphs can never have more than 61 tables, node sets and edge lists are implemented using 6...
Definition: node_map.h:39
File containing constants that can be used throughout the server.
Definition: make_join_hypergraph.h:85
TABLE * table
Definition: make_join_hypergraph.h:86
Mem_root_array< SargablePredicate > sargable_predicates
Definition: make_join_hypergraph.h:104
Mem_root_array< Item * > join_conditions_pushable_to_this
Definition: make_join_hypergraph.h:98
A struct containing a join hypergraph of a single query block, encapsulating the constraints given by...
Definition: make_join_hypergraph.h:70
unsigned num_where_predicates
Definition: make_join_hypergraph.h:119
Mem_root_array< Node > nodes
Definition: make_join_hypergraph.h:106
bool has_reordered_left_joins
Whether, at any point, we could rewrite (t1 LEFT JOIN t2) LEFT JOIN t3 to t1 LEFT JOIN (t2 LEFT JOIN ...
Definition: make_join_hypergraph.h:148
hypergraph::Hypergraph graph
Definition: make_join_hypergraph.h:78
mem_root_unordered_map< Item *, int > sargable_join_predicates
Definition: make_join_hypergraph.h:129
const Query_block * query_block() const
Returns a pointer to the query block that is being planned.
Definition: make_join_hypergraph.h:132
JoinHypergraph(MEM_ROOT *mem_root, const Query_block *query_block)
Definition: make_join_hypergraph.h:71
const JOIN * join() const
Returns a pointer to the JOIN object of the query block being planned.
Definition: make_join_hypergraph.cc:3118
const Query_block * m_query_block
A pointer to the query block being planned.
Definition: make_join_hypergraph.h:152
Mem_root_array< Predicate > predicates
Definition: make_join_hypergraph.h:117
OverflowBitset materializable_predicates
Definition: make_join_hypergraph.h:123
std::array< int, MAX_TABLES > table_num_to_node_num
Definition: make_join_hypergraph.h:83
Mem_root_array< JoinPredicate > edges
Definition: make_join_hypergraph.h:110
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82
Represents an expression tree in the relational algebra of joins.
Definition: relational_expression.h:85
A sargable (from “Search ARGument”) predicate is one that we can attempt to push down into an index (...
Definition: make_join_hypergraph.h:49
int predicate_index
Definition: make_join_hypergraph.h:51
Field * field
Definition: make_join_hypergraph.h:56
Item * other_side
Definition: make_join_hypergraph.h:57
Definition: hypergraph.h:85