24#ifndef SQL_JOIN_OPTIMIZER_HYPERGRAPH_H_
25#define SQL_JOIN_OPTIMIZER_HYPERGRAPH_H_ 1
75 static constexpr int Size =
76 sizeof(std::vector<unsigned>) * 2 +
sizeof(
NodeMap);
79static_assert(
sizeof(
Node) >= 64);
113 return std::has_single_bit(left) && std::has_single_bit(right);
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:426
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
Definition: hypergraph.cc:30
bool IsSimpleEdge(NodeMap left, NodeMap right)
Is an edge between "left" and "right" a simple edge?
Definition: hypergraph.h:112
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:40
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: hypergraph.h:81
NodeMap left
Definition: hypergraph.h:86
NodeMap right
Definition: hypergraph.h:87
Definition: hypergraph.h:90
Mem_root_array< Node > nodes
Definition: hypergraph.h:93
void AddNode()
Definition: hypergraph.cc:32
Hypergraph(MEM_ROOT *mem_root)
Definition: hypergraph.h:92
void AddEdge(NodeMap left, NodeMap right)
Definition: hypergraph.cc:34
void AttachEdgeToNodes(size_t left_first_idx, size_t right_first_idx, NodeMap left, NodeMap right)
Definition: hypergraph.cc:117
Mem_root_array< Hyperedge > edges
Definition: hypergraph.h:94
void ModifyEdge(unsigned edge_idx, NodeMap new_left, NodeMap new_right)
Definition: hypergraph.cc:58
Definition: hypergraph.h:52
char padding[std::max< int >(1, 64 - Size)]
Definition: hypergraph.h:77
std::vector< unsigned > complex_edges
Definition: hypergraph.h:66
static constexpr int Size
Definition: hypergraph.h:75
NodeMap simple_neighborhood
Definition: hypergraph.h:69
std::vector< unsigned > simple_edges
Definition: hypergraph.h:66