MySQL 9.1.0
Source Code Documentation
anonymous_namespace{opt_explain.cc}::Explain_join Class Reference

Explain_join class produces EXPLAIN output for JOINs. More...

Inheritance diagram for anonymous_namespace{opt_explain.cc}::Explain_join:
[legend]

Public Member Functions

 Explain_join (THD *explain_thd_arg, const THD *query_thd_arg, Query_block *query_block_arg, bool need_tmp_table_arg, bool need_order_arg, bool distinct_arg)
 
- Public Member Functions inherited from anonymous_namespace{opt_explain.cc}::Explain
virtual ~Explain ()=default
 
bool send ()
 Explain class main function. More...
 
bool can_print_clauses () const
 Tells if it is allowed to print the WHERE / GROUP BY / etc clauses. More...
 

Protected Member Functions

bool shallow_explain () override
 Explain everything but subqueries. More...
 
bool explain_table_name () override
 
bool explain_join_type () override
 
bool explain_key_and_len () override
 fill col_key and and col_key_len fields together More...
 
bool explain_ref () override
 
bool explain_rows_and_filtered () override
 fill col_rows and col_filtered fields together More...
 
bool explain_extra () override
 
bool explain_select_type () override
 
bool explain_id () override
 
bool explain_modify_flags () override
 
bool can_walk_clauses () override
 Returns true if the WHERE, ORDER BY, GROUP BY, etc clauses can safely be traversed: it means that we can iterate through them (no element is added/removed/replaced); the internal details of an element can change though (in particular if that element is an Item_subselect). More...
 
- Protected Member Functions inherited from anonymous_namespace{opt_explain.cc}::Explain_table_base
 Explain_table_base (enum_parsing_context context_type_arg, THD *const explain_thd_arg, const THD *query_thd_arg, Query_block *query_block_arg=nullptr, TABLE *const table_arg=nullptr)
 
bool explain_partitions () override
 
bool explain_possible_keys () override
 
bool explain_key_parts (int key, uint key_parts)
 
bool explain_key_and_len_quick (AccessPath *range_scan)
 
bool explain_key_and_len_index (int key)
 
bool explain_key_and_len_index (int key, uint key_length, uint key_parts)
 
bool explain_extra_common (int range_scan_type, uint keyno)
 
bool explain_tmptable_and_filesort (bool need_tmp_table_arg, bool need_sort_arg)
 
- Protected Member Functions inherited from anonymous_namespace{opt_explain.cc}::Explain
 Explain (enum_parsing_context context_type_arg, THD *explain_thd_arg, const THD *query_thd_arg, Query_block *query_block_arg)
 
bool explain_subqueries ()
 Explain the rest of things after the shallow_explain() call. More...
 
bool mark_subqueries (Item *item, qep_row *destination)
 Qualify subqueries with WHERE/HAVING/ORDER BY/GROUP BY clause type marker. More...
 
bool prepare_columns ()
 Pre-calculate table property values for further EXPLAIN output. More...
 
bool push_extra (Extra_tag tag)
 Push a part of the "extra" column into formatter. More...
 
bool push_extra (Extra_tag tag, const String &arg)
 Push a part of the "extra" column into formatter. More...
 
bool push_extra (Extra_tag tag, const char *arg)
 Push a part of the "extra" column into formatter. More...
 
virtual enum_parsing_context get_subquery_context (Query_expression *unit) const
 

Private Member Functions

bool begin_sort_context (Explain_sort_clause clause, enum_parsing_context ctx)
 
bool end_sort_context (Explain_sort_clause clause, enum_parsing_context ctx)
 
bool begin_simple_sort_context (Explain_sort_clause clause, enum_parsing_context ctx)
 
bool end_simple_sort_context (Explain_sort_clause clause, enum_parsing_context ctx)
 
bool explain_qep_tab (size_t tab_num)
 

Private Attributes

bool need_tmp_table
 add "Using temporary" to "extra" if true More...
 
bool need_order
 add "Using filesort"" to "extra" if true More...
 
const bool distinct
 add "Distinct" string to "extra" column if true More...
 
JOINjoin
 current JOIN More...
 
int range_scan_type
 current range scan type, really an AccessPath::Type More...
 

Additional Inherited Members

- Protected Attributes inherited from anonymous_namespace{opt_explain.cc}::Explain_table_base
QEP_TABtab {nullptr}
 The QEP_TAB which we are currently explaining. More...
 
const TABLEtable {nullptr}
 
join_type type {JT_UNKNOWN}
 
AccessPathrange_scan_path {nullptr}
 
Itemcondition {nullptr}
 
bool dynamic_range {false}
 
Table_reftable_ref {nullptr}
 
bool skip_records_in_range {false}
 
bool reversed_access {false}
 
Key_map usable_keys
 
- Protected Attributes inherited from anonymous_namespace{opt_explain.cc}::Explain
THD *const explain_thd
 cached THD which runs the EXPLAIN command More...
 
const THDquery_thd
 THD which runs the query to be explained. More...
 
const CHARSET_INFO *const cs
 cached pointer to system_charset_info More...
 
Query_block *const query_block
 Cached Query_block of the explained query. More...
 
Explain_format *const fmt
 shortcut for thd->lex->explain_format More...
 
enum_parsing_context context_type
 associated value for struct. explain More...
 
bool order_list
 if query block has ORDER BY More...
 
const bool explain_other
 if we explain other thread than us More...
 

Detailed Description

Explain_join class produces EXPLAIN output for JOINs.

Constructor & Destructor Documentation

◆ Explain_join()

anonymous_namespace{opt_explain.cc}::Explain_join::Explain_join ( THD explain_thd_arg,
const THD query_thd_arg,
Query_block query_block_arg,
bool  need_tmp_table_arg,
bool  need_order_arg,
bool  distinct_arg 
)
inline

Member Function Documentation

◆ begin_simple_sort_context()

bool Explain_join::begin_simple_sort_context ( Explain_sort_clause  clause,
enum_parsing_context  ctx 
)
private

◆ begin_sort_context()

bool Explain_join::begin_sort_context ( Explain_sort_clause  clause,
enum_parsing_context  ctx 
)
private

◆ can_walk_clauses()

bool anonymous_namespace{opt_explain.cc}::Explain_join::can_walk_clauses ( )
inlineoverrideprotectedvirtual

Returns true if the WHERE, ORDER BY, GROUP BY, etc clauses can safely be traversed: it means that we can iterate through them (no element is added/removed/replaced); the internal details of an element can change though (in particular if that element is an Item_subselect).

By default, if we are explaining another connection, this is not safe.

Reimplemented from anonymous_namespace{opt_explain.cc}::Explain.

◆ end_simple_sort_context()

bool Explain_join::end_simple_sort_context ( Explain_sort_clause  clause,
enum_parsing_context  ctx 
)
private

◆ end_sort_context()

bool Explain_join::end_sort_context ( Explain_sort_clause  clause,
enum_parsing_context  ctx 
)
private

◆ explain_extra()

bool Explain_join::explain_extra ( )
overrideprotectedvirtual

◆ explain_id()

bool Explain_join::explain_id ( )
overrideprotectedvirtual

◆ explain_join_type()

bool Explain_join::explain_join_type ( )
overrideprotectedvirtual

◆ explain_key_and_len()

bool Explain_join::explain_key_and_len ( )
overrideprotectedvirtual

fill col_key and and col_key_len fields together

Reimplemented from anonymous_namespace{opt_explain.cc}::Explain.

◆ explain_modify_flags()

bool Explain_join::explain_modify_flags ( )
overrideprotectedvirtual

◆ explain_qep_tab()

bool Explain_join::explain_qep_tab ( size_t  tab_num)
private

◆ explain_ref()

bool Explain_join::explain_ref ( )
overrideprotectedvirtual

◆ explain_rows_and_filtered()

bool Explain_join::explain_rows_and_filtered ( )
overrideprotectedvirtual

fill col_rows and col_filtered fields together

Reimplemented from anonymous_namespace{opt_explain.cc}::Explain.

◆ explain_select_type()

bool Explain_join::explain_select_type ( )
overrideprotectedvirtual

◆ explain_table_name()

bool Explain_join::explain_table_name ( )
overrideprotectedvirtual

◆ shallow_explain()

bool Explain_join::shallow_explain ( )
overrideprotectedvirtual

Explain everything but subqueries.

Reimplemented from anonymous_namespace{opt_explain.cc}::Explain.

Member Data Documentation

◆ distinct

const bool anonymous_namespace{opt_explain.cc}::Explain_join::distinct
private

add "Distinct" string to "extra" column if true

◆ join

JOIN* anonymous_namespace{opt_explain.cc}::Explain_join::join
private

current JOIN

◆ need_order

bool anonymous_namespace{opt_explain.cc}::Explain_join::need_order
private

add "Using filesort"" to "extra" if true

◆ need_tmp_table

bool anonymous_namespace{opt_explain.cc}::Explain_join::need_tmp_table
private

add "Using temporary" to "extra" if true

◆ range_scan_type

int anonymous_namespace{opt_explain.cc}::Explain_join::range_scan_type
private

current range scan type, really an AccessPath::Type


The documentation for this class was generated from the following file: