MySQL 8.0.40
Source Code Documentation
|
A base for all Explain_* classes. More...
Classes | |
class | Lazy_condition |
Public Member Functions | |
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 | |
Explain (enum_parsing_context context_type_arg, THD *explain_thd_arg, const THD *query_thd_arg, Query_block *query_block_arg) | |
virtual bool | shallow_explain () |
Explain everything but subqueries. More... | |
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 bool | explain_id () |
virtual bool | explain_select_type () |
virtual bool | explain_table_name () |
virtual bool | explain_partitions () |
virtual bool | explain_join_type () |
virtual bool | explain_possible_keys () |
virtual bool | explain_key_and_len () |
fill col_key and and col_key_len fields together More... | |
virtual bool | explain_ref () |
virtual bool | explain_rows_and_filtered () |
fill col_rows and col_filtered fields together More... | |
virtual bool | explain_extra () |
virtual bool | explain_modify_flags () |
virtual bool | can_walk_clauses () |
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... | |
virtual enum_parsing_context | get_subquery_context (Query_expression *unit) const |
Protected Attributes | |
THD *const | explain_thd |
cached THD which runs the EXPLAIN command More... | |
const THD * | query_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... | |
Private Member Functions | |
virtual bool | skip_subqueries () const |
Returns true if EXPLAIN should not produce any information about subqueries. More... | |
A base for all Explain_* classes.
Explain_* classes collect and output EXPLAIN data.
This class hierarchy is a successor of the old select_describe() function of 5.5.
|
inlineexplicitprotected |
|
virtualdefault |
|
inline |
Tells if it is allowed to print the WHERE / GROUP BY / etc clauses.
|
inlineprotectedvirtual |
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 in anonymous_namespace{opt_explain.cc}::Explain_setop_result, anonymous_namespace{opt_explain.cc}::Explain_join, and anonymous_namespace{opt_explain.cc}::Explain_table.
|
inlineprotectedvirtual |
Reimplemented in anonymous_namespace{opt_explain.cc}::Explain_no_table, anonymous_namespace{opt_explain.cc}::Explain_setop_result, anonymous_namespace{opt_explain.cc}::Explain_join, anonymous_namespace{opt_explain.cc}::Explain_table, and anonymous_namespace{opt_explain.cc}::Explain_secondary_engine.
|
protectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
fill col_key and and col_key_len fields together
Reimplemented in anonymous_namespace{opt_explain.cc}::Explain_join, and anonymous_namespace{opt_explain.cc}::Explain_table.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Reimplemented in anonymous_namespace{opt_explain.cc}::Explain_table_base.
|
inlineprotectedvirtual |
Reimplemented in anonymous_namespace{opt_explain.cc}::Explain_table_base.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
fill col_rows and col_filtered fields together
Reimplemented in anonymous_namespace{opt_explain.cc}::Explain_no_table, anonymous_namespace{opt_explain.cc}::Explain_join, and anonymous_namespace{opt_explain.cc}::Explain_table.
|
protectedvirtual |
|
protected |
Explain the rest of things after the shallow_explain()
call.
Traverses SQL clauses of this query specification to identify children subqueries, marks each of them with the clause they belong to.
Then goes though all children subqueries and produces their EXPLAIN output, attached to the proper clause's context.
false | Ok |
true | Error (OOM) |
|
inlineprotectedvirtual |
|
protectedvirtual |
Reimplemented in anonymous_namespace{opt_explain.cc}::Explain_no_table.
Qualify subqueries with WHERE/HAVING/ORDER BY/GROUP BY clause type marker.
item | Item tree to find subqueries |
destination | For WHERE clauses |
destination
parameter provides a pointer to QEP data for such a table to associate a future subquery EXPLAIN output with table QEP provided.false | OK |
true | Error |
|
protected |
Pre-calculate table property values for further EXPLAIN output.
|
inlineprotected |
Push a part of the "extra" column into formatter.
Traditional formatter outputs traditional_extra_tags[tag] as is. Hierarchical formatter outputs a property with the json_extra_tags[tag] name and a boolean value of true.
tag | type of the "extra" part |
false | Ok |
true | Error (OOM) |
|
inlineprotected |
Push a part of the "extra" column into formatter.
tag | type of the "extra" part |
arg | for traditional formatter: rest of the part text, for hierarchical format: string value of the property |
NOTE: arg must be a long-living string constant.
false | Ok |
true | Error (OOM) |
|
inlineprotected |
Push a part of the "extra" column into formatter.
tag | type of the "extra" part |
arg | for traditional formatter: rest of the part text, for hierarchical format: string value of the property |
false | Ok |
true | Error (OOM) |
bool Explain::send | ( | ) |
Explain class main function.
This function: a) allocates a Query_result_send object (if no one pre-allocated available), b) calculates and sends whole EXPLAIN data.
|
protectedvirtual |
Explain everything but subqueries.
Reimplemented in anonymous_namespace{opt_explain.cc}::Explain_no_table, anonymous_namespace{opt_explain.cc}::Explain_join, and anonymous_namespace{opt_explain.cc}::Explain_table.
|
inlineprivatevirtual |
Returns true if EXPLAIN should not produce any information about subqueries.
Reimplemented in anonymous_namespace{opt_explain.cc}::Explain_secondary_engine.
|
protected |
associated value for struct. explain
|
protected |
cached pointer to system_charset_info
|
protected |
if we explain other thread than us
|
protected |
cached THD which runs the EXPLAIN command
|
protected |
shortcut for thd->lex->explain_format
|
protected |
if query block has ORDER BY
|
protected |
Cached Query_block of the explained query.
Used for all explained stmts, including single-table UPDATE (provides way to access ORDER BY of UPDATE).
|
protected |
THD which runs the query to be explained.