23#ifndef SQL_JOIN_OPTIMIZER_HYPERGRAPH_H_
24#define SQL_JOIN_OPTIMIZER_HYPERGRAPH_H_ 1
74 static constexpr int Size =
75 sizeof(std::vector<unsigned>) * 2 +
sizeof(
NodeMap);
78static_assert(
sizeof(
Node) >= 64);
112 return std::has_single_bit(left) && std::has_single_bit(right);
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:425
static MEM_ROOT mem_root
Definition: client_plugin.cc:113
Definition: hypergraph.cc:29
bool IsSimpleEdge(NodeMap left, NodeMap right)
Is an edge between "left" and "right" a simple edge?
Definition: hypergraph.h:111
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
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82
Definition: hypergraph.h:80
NodeMap left
Definition: hypergraph.h:85
NodeMap right
Definition: hypergraph.h:86
Definition: hypergraph.h:89
Mem_root_array< Node > nodes
Definition: hypergraph.h:92
void AddNode()
Definition: hypergraph.cc:31
Hypergraph(MEM_ROOT *mem_root)
Definition: hypergraph.h:91
void AddEdge(NodeMap left, NodeMap right)
Definition: hypergraph.cc:33
void AttachEdgeToNodes(size_t left_first_idx, size_t right_first_idx, NodeMap left, NodeMap right)
Definition: hypergraph.cc:116
Mem_root_array< Hyperedge > edges
Definition: hypergraph.h:93
void ModifyEdge(unsigned edge_idx, NodeMap new_left, NodeMap new_right)
Definition: hypergraph.cc:57
Definition: hypergraph.h:51
char padding[std::max< int >(1, 64 - Size)]
Definition: hypergraph.h:76
std::vector< unsigned > complex_edges
Definition: hypergraph.h:65
static constexpr int Size
Definition: hypergraph.h:74
NodeMap simple_neighborhood
Definition: hypergraph.h:68
std::vector< unsigned > simple_edges
Definition: hypergraph.h:65