24#ifndef SQL_RANGE_OPTIMIZER_ROWID_ORDERED_RETRIEVAL_PLAN_H_
25#define SQL_RANGE_OPTIMIZER_ROWID_ORDERED_RETRIEVAL_PLAN_H_
105 bool index_merge_intersect_allowed,
107 bool force_index_merge_result,
A wrapper class which provides array bounds checking.
Definition: sql_array.h:47
Used to store optimizer cost estimates.
Definition: handler.h:3877
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:426
A JSON object (unordered set of key/value pairs).
Definition: opt_trace.h:802
Definition: overflow_bitset.h:78
Definition: range_opt_param.h:29
Definition: rowid_ordered_retrieval_plan.h:70
Cost_estimate m_total_cost
Total cost for the plan - m_index_read_cost + disk_sweep_cost.
Definition: rowid_ordered_retrieval_plan.h:91
double get_scan_selectivity(const ROR_SCAN_INFO *scan) const
Definition: rowid_ordered_retrieval_plan.cc:370
ROR_intersect_plan(const ROR_intersect_plan &)=delete
ha_rows m_index_records
Number of rows to be read from indexes that are used for rowid ordered scans.
Definition: rowid_ordered_retrieval_plan.h:98
OverflowBitset m_covered_fields
Bitmap of fields covered by the scans in the plan.
Definition: rowid_ordered_retrieval_plan.h:95
ROR_intersect_plan & operator=(const ROR_intersect_plan &plan)
Definition: rowid_ordered_retrieval_plan.cc:255
bool m_is_covering
Whether this plan with the chosen rowid ordered scans is covering or not.
Definition: rowid_ordered_retrieval_plan.h:87
ROR_intersect_plan(const RANGE_OPT_PARAM *param, size_t num_fields)
Definition: rowid_ordered_retrieval_plan.cc:247
double m_out_rows
Output rows for this plan.
Definition: rowid_ordered_retrieval_plan.h:89
const RANGE_OPT_PARAM * m_param
Range optimizer parameter.
Definition: rowid_ordered_retrieval_plan.h:83
bool add(OverflowBitset needed_fields, ROR_SCAN_INFO *ror_scan, bool is_cpk_scan, Opt_trace_object *trace_costs, bool ignore_cost)
Definition: rowid_ordered_retrieval_plan.cc:514
size_t num_scans() const
Definition: rowid_ordered_retrieval_plan.h:79
Cost_estimate m_index_read_cost
Total cost for reading the indexes picked in the plan.
Definition: rowid_ordered_retrieval_plan.h:100
Mem_root_array< ROR_SCAN_INFO * > m_ror_scans
Rowid ordered scans that are part of this plan.
Definition: rowid_ordered_retrieval_plan.h:85
A graph of (possible multiple) key ranges, represented as a red-black binary tree.
Definition: tree.h:68
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1141
static uint verbose
Definition: mysqlcheck.cc:66
static char * path
Definition: mysqldump.cc:149
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
OverflowBitset is a fixed-size (once allocated) bitmap that is optimized for the common case of few e...
void add_keys_and_lengths_rowid_union(const AccessPath *path, String *key_names, String *used_lengths)
Definition: rowid_ordered_retrieval_plan.cc:947
AccessPath * get_best_ror_intersect(THD *thd, const RANGE_OPT_PARAM *param, TABLE *table, bool index_merge_intersect_allowed, SEL_TREE *tree, double cost_est, bool force_index_merge_result, bool reuse_handler)
Definition: rowid_ordered_retrieval_plan.cc:680
void find_intersect_order(Mem_root_array< ROR_SCAN_INFO * > *ror_scans, OverflowBitset needed_fields, MEM_ROOT *mem_root)
Sort indexes in an order that is likely to be a good index merge intersection order.
Definition: rowid_ordered_retrieval_plan.cc:216
AccessPath * MakeRowIdOrderedIndexScanAccessPath(ROR_SCAN_INFO *scan, TABLE *table, KEY_PART *used_key_part, bool reuse_handler, MEM_ROOT *mem_root)
Definition: rowid_ordered_retrieval_plan.cc:581
void add_keys_and_lengths_rowid_intersection(const AccessPath *path, String *key_names, String *used_lengths)
Definition: rowid_ordered_retrieval_plan.cc:912
void dbug_dump_rowid_union(int indent, bool verbose, const Mem_root_array< AccessPath * > &children)
Definition: rowid_ordered_retrieval_plan.cc:972
void trace_basic_info_rowid_intersection(THD *thd, const AccessPath *path, const RANGE_OPT_PARAM *param, Opt_trace_object *trace_object)
Definition: rowid_ordered_retrieval_plan.cc:112
OverflowBitset get_needed_fields(const RANGE_OPT_PARAM *param)
Definition: rowid_ordered_retrieval_plan.cc:86
ROR_SCAN_INFO * make_ror_scan(const RANGE_OPT_PARAM *param, int idx, SEL_ROOT *sel_root, OverflowBitset needed_fields)
Definition: rowid_ordered_retrieval_plan.cc:158
void trace_basic_info_rowid_union(THD *thd, const AccessPath *path, const RANGE_OPT_PARAM *param, Opt_trace_object *trace_object)
Definition: rowid_ordered_retrieval_plan.cc:130
void dbug_dump_rowid_intersection(int indent, bool verbose, const Mem_root_array< AccessPath * > &children)
Definition: rowid_ordered_retrieval_plan.cc:962
Access paths are a query planning structure that correspond 1:1 to iterators, in that an access path ...
Definition: access_path.h:227
Definition: range_optimizer.h:55
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: rowid_ordered_retrieval_plan.h:44
Cost_estimate index_read_cost
Cost of reading all index records with values in sel_arg intervals set (assuming there is no need to ...
Definition: rowid_ordered_retrieval_plan.h:59
uint keynr
Definition: rowid_ordered_retrieval_plan.h:46
SEL_ROOT * sel_root
Set of intervals over key fields that will be used for row retrieval.
Definition: rowid_ordered_retrieval_plan.h:50
uint idx
Definition: rowid_ordered_retrieval_plan.h:45
uint used_key_parts
Definition: rowid_ordered_retrieval_plan.h:65
ha_rows records
estimate of # records this scan will return
Definition: rowid_ordered_retrieval_plan.h:47
OverflowBitset covered_fields
Fields used in the query and covered by this ROR scan.
Definition: rowid_ordered_retrieval_plan.h:53
Bounds_checked_array< QUICK_RANGE * > ranges
The ranges to scan for this index.
Definition: rowid_ordered_retrieval_plan.h:64