MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Explain Class Reference
Inheritance diagram for Explain:
Collaboration diagram for Explain:

Classes

class  Lazy_condition

Public Member Functions

bool send ()

Protected Member Functions

 Explain (Explain_context_enum context_type_arg, THD *thd_arg, JOIN *join_arg=NULL)
virtual bool shallow_explain ()
bool explain_subqueries (select_result *result)
bool mark_subqueries (Item *item, qep_row *destination, Explain_context_enum type)
bool mark_order_subqueries (const JOIN::ORDER_with_src &order)
bool prepare_columns ()
bool describe (uint8 mask) const
SELECT_LEX * select_lex () const
bool prepare (select_result *result)
bool push_extra (Extra_tag tag)
bool push_extra (Extra_tag tag, const String &arg)
bool push_extra (Extra_tag tag, const char *arg)
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 ()
virtual bool explain_ref ()
virtual bool explain_rows_and_filtered ()
virtual bool explain_extra ()
virtual bool explain_modify_flags ()

Protected Attributes

THD *const thd
 cached THD pointer
const CHARSET_INFO *const cs
 cached pointer to system_charset_info
JOIN *const join
 top-level JOIN (if any) provided by caller
select_result *const external_result
 stream (if any) provided by caller
Explain_format *const fmt
 shortcut for thd->lex->explain_format
Explain_context_enum context_type
 associated value for struct. explain
JOIN::ORDER_with_src order_list
JOIN::ORDER_with_src group_list

Detailed Description

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.

Definition at line 51 of file opt_explain.cc.

Member Function Documentation

virtual bool Explain::explain_key_and_len ( )
inlineprotectedvirtual

fill col_key and and col_key_len fields together

Reimplemented in Explain_join.

Definition at line 220 of file opt_explain.cc.

Here is the caller graph for this function:

virtual bool Explain::explain_rows_and_filtered ( )
inlineprotectedvirtual

fill col_rows and col_filtered fields together

Reimplemented in Explain_join, and Explain_no_table.

Definition at line 223 of file opt_explain.cc.

Here is the caller graph for this function:

bool Explain::explain_subqueries ( select_result *  result)
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.

Parameters
resultresult stream
Return values
falseOk
trueError (OOM)

Definition at line 539 of file opt_explain.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Explain::mark_subqueries ( Item item,
qep_row destination,
Explain_context_enum  type 
)
protected

Qualify subqueries with WHERE/HAVING/ORDER BY/GROUP BY clause type marker

Parameters
itemItem tree to find subqueries
destinationFor WHERE clauses
typeClause type
Note
WHERE clause belongs to TABLE or JOIN_TAB. The destination parameter provides a pointer to QEP data for such a table to associate a future subquery EXPLAIN output with table QEP provided.
Return values
falseOK
trueError

Definition at line 464 of file opt_explain.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Explain::prepare ( select_result *  result)
inlineprotected

Prepare the self-allocated result object

For queries with top-level JOIN the caller provides pre-allocated select_send object. Then that JOIN object prepares the select_send object calling result->prepare() in JOIN::prepare(), result->initalize_tables() in JOIN::optimize() and result->prepare2() in JOIN::exec(). However without the presence of the top-level JOIN we have to prepare/initialize select_send object manually.

Definition at line 145 of file opt_explain.cc.

Here is the caller graph for this function:

bool Explain::prepare_columns ( )
protected

Pre-calculate table property values for further EXPLAIN output

Definition at line 656 of file opt_explain.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Explain::push_extra ( Extra_tag  tag)
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.

Parameters
tagtype of the "extra" part
Return values
falseOk
trueError (OOM)

Definition at line 165 of file opt_explain.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Explain::push_extra ( Extra_tag  tag,
const String arg 
)
inlineprotected

Push a part of the "extra" column into formatter

Parameters
tagtype of the "extra" part
argfor traditional formatter: rest of the part text, for hierarchical format: string value of the property
Return values
falseOk
trueError (OOM)

Definition at line 181 of file opt_explain.cc.

Here is the call graph for this function:

bool Explain::push_extra ( Extra_tag  tag,
const char *  arg 
)
inlineprotected

Push a part of the "extra" column into formatter

Parameters
tagtype of the "extra" part
argfor traditional formatter: rest of the part text, for hierarchical format: string value of the property

NOTE: arg must be a long-living string constant.

Return values
falseOk
trueError (OOM)

Definition at line 201 of file opt_explain.cc.

Here is the call graph for this function:

bool Explain::send ( )

Explain class main function

This function: a) allocates a select_send object (if no one pre-allocated available), b) calculates and sends whole EXPLAIN data.

Returns
false if success, true if error

Definition at line 682 of file opt_explain.cc.

Here is the call graph for this function:

bool Explain::shallow_explain ( )
protectedvirtual

Explain everything but subqueries

Reimplemented in Explain_join, and Explain_no_table.

Definition at line 443 of file opt_explain.cc.

Here is the call graph for this function:

Here is the caller graph for this function:


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