![]() |
MySQL 8.0.29
Source Code Documentation
|
#include "sql/join_optimizer/interesting_orders.h"
#include "sql/join_optimizer/node_map.h"
#include <string>
Go to the source code of this file.
Classes | |
struct | SortAheadOrdering |
struct | ActiveIndexInfo |
struct | FullTextIndexInfo |
Functions | |
void | BuildInterestingOrders (THD *thd, JoinHypergraph *graph, Query_block *query_block, LogicalOrderings *orderings, Mem_root_array< SortAheadOrdering > *sort_ahead_orderings, int *order_by_ordering_idx, int *group_by_ordering_idx, int *distinct_ordering_idx, Mem_root_array< ActiveIndexInfo > *active_indexes, Mem_root_array< FullTextIndexInfo > *fulltext_searches, std::string *trace) |
Build all structures we need for keeping track of interesting orders. More... | |
ORDER * | BuildSortAheadOrdering (THD *thd, const LogicalOrderings *orderings, Ordering ordering) |
void BuildInterestingOrders | ( | THD * | thd, |
JoinHypergraph * | graph, | ||
Query_block * | query_block, | ||
LogicalOrderings * | orderings, | ||
Mem_root_array< SortAheadOrdering > * | sort_ahead_orderings, | ||
int * | order_by_ordering_idx, | ||
int * | group_by_ordering_idx, | ||
int * | distinct_ordering_idx, | ||
Mem_root_array< ActiveIndexInfo > * | active_indexes, | ||
Mem_root_array< FullTextIndexInfo > * | fulltext_searches, | ||
std::string * | trace | ||
) |
Build all structures we need for keeping track of interesting orders.
We collect the actual relevant orderings (e.g. from ORDER BY) and any functional dependencies we can find, then ask LogicalOrderings to create its state machine (as defined in interesting_orders.h). The result is said state machine, a list of potential sort-ahead orderings, and a list of what indexes we can use to scan each table (including what orderings they yield, if they are interesting).
ORDER * BuildSortAheadOrdering | ( | THD * | thd, |
const LogicalOrderings * | orderings, | ||
Ordering | ordering | ||
) |