24#ifndef SQL_JOIN_OPTIMIZER_GRAPH_SIMPLIFICATION_H_
25#define SQL_JOIN_OPTIMIZER_GRAPH_SIMPLIFICATION_H_
144 assert(
m_done_steps.size() <
size_t{std::numeric_limits<int>::max()});
150 assert(
m_undone_steps.size() <
size_t{std::numeric_limits<int>::max()});
303 (*cache)->index_in_pq =
index;
308 std::vector<NeighborCache *, Mem_root_allocator<NeighborCache *>>,
309 CompareByBenefit, MarkNeighborCache>
A wrapper class which provides array bounds checking.
Definition: sql_array.h:48
Definition: graph_simplification.h:96
ALWAYS_INLINE bool EdgesAreNeighboring(size_t edge1_idx, size_t edge2_idx, ProposedSimplificationStep *step)
Definition: graph_simplification.cc:687
Bounds_checked_array< NeighborCache > m_cache
Definition: graph_simplification.h:291
THD * m_thd
Definition: graph_simplification.h:213
void RecalculateNeighbors(size_t edge1_idx, size_t begin, size_t end)
Definition: graph_simplification.cc:636
GraphSimplifier(THD *thd, JoinHypergraph *graph)
Definition: graph_simplification.cc:591
SimplificationStep ConcretizeSimplificationStep(GraphSimplifier::ProposedSimplificationStep step)
Definition: graph_simplification.cc:819
JoinHypergraph * m_graph
Definition: graph_simplification.h:240
SimplificationResult
Definition: graph_simplification.h:103
@ APPLIED_REDO_STEP
Definition: graph_simplification.h:121
@ NO_SIMPLIFICATION_POSSIBLE
Definition: graph_simplification.h:105
@ APPLIED_SIMPLIFICATION
Definition: graph_simplification.h:109
@ APPLIED_NOOP
Definition: graph_simplification.h:116
Bounds_checked_array< EdgeMetrics > m_edge_metrics
Definition: graph_simplification.h:237
void UndoSimplificationStep()
Definition: graph_simplification.cc:947
SimplificationResult DoSimplificationStep()
Definition: graph_simplification.cc:874
Mem_root_array< SimplificationStep > m_undone_steps
Definition: graph_simplification.h:222
void UpdatePQ(size_t edge_idx)
Definition: graph_simplification.cc:616
int num_steps_done() const
Definition: graph_simplification.h:143
int num_steps_undone() const
Definition: graph_simplification.h:149
Priority_queue< NeighborCache *, std::vector< NeighborCache *, Mem_root_allocator< NeighborCache * > >, CompareByBenefit, MarkNeighborCache > m_pq
Definition: graph_simplification.h:310
OnlineCycleFinder m_cycles
Definition: graph_simplification.h:245
Mem_root_array< SimplificationStep > m_done_steps
Definition: graph_simplification.h:216
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:432
A fast online cycle finder, based on [Pea03].
Definition: online_cycle_finder.h:54
Implements a priority queue using a vector-based max-heap.
Definition: priority_queue.h:104
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
void SimplifyQueryGraph(THD *thd, int subgraph_pair_limit, JoinHypergraph *graph, GraphSimplifier *simplifier)
Repeatedly apply simplifications (in the order of most to least safe) to the given hypergraph,...
Definition: graph_simplification.cc:991
void SetNumberOfSimplifications(int num_simplifications, GraphSimplifier *simplifier)
Definition: graph_simplification.cc:960
Definition of an undirected (join) hypergraph.
Header for compiler-dependent features.
#define ALWAYS_INLINE
Definition: my_compiler.h:99
bool index(const std::string &value, const String &search_for, uint32_t *idx)
Definition: contains.h:76
const char * begin(const char *const c)
Definition: base64.h:44
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
Definition: graph_simplification.h:296
bool operator()(const NeighborCache *a, const NeighborCache *b) const
Definition: graph_simplification.h:297
Definition: graph_simplification.h:233
RelationMetrics right
Definition: graph_simplification.h:235
RelationMetrics left
Definition: graph_simplification.h:234
Definition: graph_simplification.h:301
void operator()(size_t index, NeighborCache **cache)
Definition: graph_simplification.h:302
Definition: graph_simplification.h:273
int best_neighbor
Definition: graph_simplification.h:280
ProposedSimplificationStep best_step
Definition: graph_simplification.h:281
int index_in_pq
Definition: graph_simplification.h:289
Definition: graph_simplification.h:186
int before_edge_idx
Definition: graph_simplification.h:188
int after_edge_idx
Definition: graph_simplification.h:189
double benefit
Definition: graph_simplification.h:187
Definition: graph_simplification.h:198
int after_edge_idx
Definition: graph_simplification.h:200
int before_edge_idx
Definition: graph_simplification.h:199
hypergraph::Hyperedge new_edge
Definition: graph_simplification.h:204
hypergraph::Hyperedge old_edge
Definition: graph_simplification.h:203
A struct containing a join hypergraph of a single query block, encapsulating the constraints given by...
Definition: make_join_hypergraph.h:98
An estimate of the output from table access or join.
Definition: graph_simplification.h:88
double rows
The number of outpur rows.
Definition: graph_simplification.h:90
double row_size
The average row size.
Definition: graph_simplification.h:92
Definition: hypergraph.h:81