My Project
Classes | Public Member Functions | Protected Member Functions | Protected Attributes
Explain Class Reference
Inheritance diagram for Explain:
Explain_no_table Explain_table_base Explain_union_result Explain_join Explain_table

List of all members.

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.


Member Function Documentation

virtual bool Explain::explain_key_and_len ( ) [inline, protected, virtual]

fill col_key and and col_key_len fields together

Reimplemented in Explain_join.

virtual bool Explain::explain_rows_and_filtered ( ) [inline, protected, virtual]

fill col_rows and col_filtered fields together

Reimplemented in Explain_join, and Explain_no_table.

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)
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
bool Explain::prepare ( select_result *  result) [inline, protected]

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.

bool Explain::prepare_columns ( ) [protected]

Pre-calculate table property values for further EXPLAIN output

bool Explain::push_extra ( Extra_tag  tag) [inline, protected]

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)
bool Explain::push_extra ( Extra_tag  tag,
const String arg 
) [inline, protected]

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)
bool Explain::push_extra ( Extra_tag  tag,
const char *  arg 
) [inline, protected]

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)
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
bool Explain::shallow_explain ( ) [protected, virtual]

Explain everything but subqueries

Reimplemented in Explain_join, and Explain_no_table.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines