My Project
|
Classes | |
class | ORDER_with_src |
class | Prepare_error_tracker |
RAII class to ease the call of LEX::mark_broken() if error. | |
Public Types | |
enum | { ordered_index_void, ordered_index_group_by, ordered_index_order_by } |
Public Member Functions | |
JOIN (THD *thd_arg, List< Item > &fields_arg, ulonglong select_options_arg, select_result *result_arg) | |
void | init (THD *thd_arg, List< Item > &fields_arg, ulonglong select_options_arg, select_result *result_arg) |
bool | plan_is_const () const |
True if plan is const, ie it will return zero or one rows. | |
bool | plan_is_single_table () |
int | prepare (TABLE_LIST *tables, uint wind_num, Item *conds, uint og_num, ORDER *order, ORDER *group, Item *having, SELECT_LEX *select, SELECT_LEX_UNIT *unit) |
int | optimize () |
void | reset () |
void | exec () |
bool | prepare_result (List< Item > **columns_list) |
bool | explain () |
bool | destroy () |
void | restore_tmp () |
bool | alloc_func_list () |
bool | flatten_subqueries () |
bool | make_sum_func_list (List< Item > &all_fields, List< Item > &send_fields, bool before_group_by, bool recompute=FALSE) |
Ref_ptr_array | ref_ptr_array_slice (size_t slice_num) |
Initialzes a slice, see comments for ref_ptrs above. | |
void | copy_ref_ptr_array (Ref_ptr_array dst_arr, Ref_ptr_array src_arr) |
void | set_items_ref_array (Ref_ptr_array src_arr) |
Overwrites 'ref_ptrs' and remembers the the source as 'current'. | |
void | init_items_ref_array () |
Initializes 'items0' and remembers that it is 'current'. | |
bool | rollup_init () |
bool | rollup_process_const_fields () |
bool | rollup_make_fields (List< Item > &all_fields, List< Item > &fields, Item_sum ***func) |
int | rollup_send_data (uint idx) |
int | rollup_write_data (uint idx, TABLE *table) |
void | remove_subq_pushed_predicates (Item **where) |
void | join_free () |
void | cleanup (bool full) |
void | clear () |
bool | save_join_tab () |
void | restore_join_tab () |
bool | init_save_join_tab () |
bool | send_row_on_empty_set () const |
bool | change_result (select_result *result) |
bool | is_top_level_join () const |
bool | cache_const_exprs () |
bool | generate_derived_keys () |
Add keys to derived tables'/views' result tables in a list. | |
void | drop_unused_derived_keys () |
Drop unused keys for each materialized derived table/view. | |
bool | get_best_combination () |
bool | update_equalities_for_sjm () |
bool | add_sorting_to_table (JOIN_TAB *tab, ORDER_with_src *order) |
Add Filesort object to the given table to sort if with filesort. | |
bool | decide_subquery_strategy () |
void | refine_best_rowcount () |
void | set_semijoin_embedding () |
Public Attributes | |
JOIN_TAB * | join_tab |
JOIN_TAB ** | best_ref |
JOIN_TAB ** | map2table |
mapping between table indexes and JOIN_TABs | |
TABLE ** | table |
TABLE * | sort_by_table |
uint | tables |
Total number of tables in query block. | |
uint | primary_tables |
Number of primary input tables in query block. | |
uint | const_tables |
Number of primary tables deemed constant. | |
uint | tmp_tables |
Number of temporary tables used by query. | |
uint | send_group_parts |
bool | sort_and_group |
bool | first_record |
bool | full_join |
bool | no_field_update |
bool | group |
If query contains GROUP BY clause. | |
bool | do_send_rows |
table_map | all_table_map |
Set of tables contained in query. | |
table_map | const_table_map |
Set of tables found to be const. | |
table_map | found_const_table_map |
table_map | outer_join |
Bitmap of all inner tables from outer joins. | |
ha_rows | send_records |
ha_rows | found_records |
ha_rows | examined_rows |
ha_rows | row_limit |
ha_rows | m_select_limit |
ha_rows | fetch_limit |
ha_rows | min_ft_matches |
POSITION * | best_positions |
POSITION * | positions |
Next_select_func | first_select |
double | best_read |
ha_rows | best_rowcount |
List< Item > * | fields |
List< Cached_item > | group_fields |
List< Cached_item > | group_fields_cache |
THD * | thd |
Item_sum ** | sum_funcs |
Item_sum *** | sum_funcs_end |
Item_sum ** | sum_funcs2 |
Item_sum *** | sum_funcs_end2 |
ulonglong | select_options |
select_result * | result |
TMP_TABLE_PARAM | tmp_table_param |
MYSQL_LOCK * | lock |
SELECT_LEX_UNIT * | unit |
unit structure (with global parameters) for this select | |
SELECT_LEX * | select_lex |
select that processed | |
bool | no_const_tables |
ROLLUP | rollup |
Used with rollup. | |
bool | select_distinct |
Set if SELECT DISTINCT. | |
bool | group_optimized_away |
bool | simple_order |
bool | simple_group |
enum JOIN:: { ... } | ordered_index_usage |
bool | no_order |
bool | skip_sort_order |
bool | need_tmp |
int | hidden_group_field_count |
Key_use_array | keyuse |
List< Item > | all_fields |
to store all expressions used in query Above list changed to use temporary table | |
List< Item > | tmp_all_fields1 |
List< Item > | tmp_all_fields2 |
List< Item > | tmp_all_fields3 |
List< Item > | tmp_fields_list1 |
Part, shared with list above, emulate following list. | |
List< Item > | tmp_fields_list2 |
List< Item > | tmp_fields_list3 |
List< Item > & | fields_list |
hold field list passed to mysql_select | |
List< Item > | procedure_fields_list |
int | error |
set in optimize(), exec(), prepare_result() | |
ORDER_with_src | order |
ORDER_with_src | group_list |
Explain_format_flags | explain_flags |
Item * | conds |
The where clause item tree. | |
Item * | having |
The having clause item tree. | |
Item * | having_for_explain |
Saved optimized HAVING for EXPLAIN. | |
TABLE_LIST * | tables_list |
hold 'tables' parameter of mysql_select | |
List< TABLE_LIST > * | join_list |
list of joined tables in reverse order | |
COND_EQUAL * | cond_equal |
JOIN_TAB * | return_tab |
Ref_ptr_array | ref_ptrs |
Ref_ptr_array | items0 |
Ref_ptr_array | items1 |
Ref_ptr_array | items2 |
Ref_ptr_array | items3 |
Ref_ptr_array | current_ref_ptrs |
const char * | zero_result_cause |
not 0 if exec must return zero result | |
bool | union_part |
this subselect is part of union | |
bool | optimized |
flag to avoid double optimization in EXPLAIN | |
bool | child_subquery_can_materialize |
bool | allow_outer_refs |
Mem_root_array < Item_exists_subselect *, true > | sj_subselects |
List< TABLE > | sj_tmp_tables |
List< Semijoin_mat_exec > | sjm_exec_list |
bool | set_group_rpa |
bool | group_sent |
void JOIN::copy_ref_ptr_array | ( | Ref_ptr_array | dst_arr, |
Ref_ptr_array | src_arr | ||
) | [inline] |
Overwrites one slice with the contents of another slice. In the normal case, dst and src have the same size(). However: the rollup slices may have smaller size than slice_sz.
bool JOIN::plan_is_single_table | ( | ) | [inline] |
True if plan contains one non-const primary table (ie not including tables taking part in semi-join materialization).
bool JOIN::send_row_on_empty_set | ( | ) | const [inline] |
Return whether the caller should send a row even if the join produced no rows if:
True if plan search is allowed to use references to expressions outer to this JOIN (for example may set up a 'ref' access looking up an outer expression in the index, etc).
double JOIN::best_read |
The cost of best complete join plan found so far during optimization, after optimization phase - cost of picked join order (not taking into account the changes made by test_if_skip_sort_order()).
ha_rows JOIN::best_rowcount |
The estimated row count of the plan with best read time (see above).
True if, at this stage of processing, subquery materialization is allowed for children subqueries of this JOIN (those in the SELECT list, in WHERE, etc). If false, and we have to evaluate a subquery at this stage, then we must choose EXISTS.
The where clause item tree.
JOIN::having is initially equal to select_lex->having, but may later be changed by optimizations performed by JOIN. The relationship between the JOIN::having condition and the associated variable select_lex->having_value is so that having_value can be:
Buffer to gather GROUP BY, ORDER BY and DISTINCT QEP details for EXPLAIN
ha_rows JOIN::fetch_limit |
Used to fetch no more than given amount of rows per one fetch operation of server side cursor. The value is checked in end_send and end_send_group in fashion, similar to offset_limit_cnt:
table_map JOIN::found_const_table_map |
Const tables which are either:
If we have the GROUP BY statement in the query, but the group_list was emptied by optimizer, this flag is TRUE. It happens when fields in the GROUP BY are from constant table
bool JOIN::group_sent |
Exec time only: TRUE <=> current group has been sent
ha_rows JOIN::min_ft_matches |
Minimum number of matches that is needed to use JT_FT access.
TRUE <=> optimizer must not mark any table as a constant table. This is needed for subqueries in form "a IN (SELECT .. UNION SELECT ..): when we optimize the select that reads the results of the union from a temporary table, we must not mark the temp. table as constant because the number of rows in it may vary from one subquery execution to another.
bool JOIN::no_order |
Is set only in case if we have a GROUP BY clause and no ORDER BY after constant elimination of 'order'.
ORDER BY and GROUP BY lists, to transform with prepare,optimize and exec
bool JOIN::set_group_rpa |
TRUE <=> ref_pointer_array is set to items3.
Is set if we have a GROUP BY and we have ORDER BY on a constant.
bool JOIN::sort_and_group |
Indicates that grouping will be performed on the result set during query execution. This field belongs to query execution.
second copy of sumfuncs (for queries with 2 temporary tables
uint JOIN::tables |
Total number of tables in query block.
Before plan has been created, "tables" denote number of input tables in the query block and "primary_tables" is equal to "tables". After plan has been created (after JOIN::get_best_combination()), the JOIN_TAB objects are enumerated as follows: