MySQL 9.0.0
Source Code Documentation
Explain_format_tree Class Reference

#include <opt_explain_traditional.h>

Inheritance diagram for Explain_format_tree:
[legend]

Public Member Functions

 Explain_format_tree ()=default
 
bool is_hierarchical () const override
 A hierarchical text or a plain table. More...
 
bool send_headers (Query_result *) override
 Send EXPLAIN header item(s) to output stream. More...
 
bool begin_context (enum_parsing_context, Query_expression *, const Explain_format_flags *) override
 Enter a specified context. More...
 
bool end_context (enum_parsing_context) override
 Leave the current context. More...
 
bool flush_entry () override
 Flush TABLE/JOIN_TAB property set. More...
 
qep_rowentry () override
 Get a pointer to the current TABLE/JOIN_TAB property set. More...
 
bool is_iterator_based (THD *explain_thd, const THD *query_thd) const override
 Whether the format closely resembles the final plan to be executed by execution iterators (See RowIterator). More...
 
std::string ExplainJsonToString (Json_object *json) override
 Convert Json object to string. More...
 
void ExplainPrintTreeNode (const Json_dom *json, int level, std::string *explain, std::vector< std::string > *tokens_for_force_subplan)
 
- Public Member Functions inherited from Explain_format
virtual ~Explain_format ()=default
 
bool is_explain_into () const
 Whether the output of an EXPLAIN statement should be stored in a user variable or sent to the client. More...
 
bool is_explain_for_schema () const
 Whether the EXPLAIN statement should be run in another schema than the current active schema. More...
 
std::string_view explain_into_variable_name () const
 Returns the name of the user variable the output of this EXPLAIN statement is to be stored in. More...
 

Private Member Functions

bool push_select_type (mem_root_deque< Item * > *items)
 
void AppendChildren (const Json_dom *children, int level, std::string *explain, std::vector< std::string > *tokens_for_force_subplan, std::string *child_token_digest)
 
void ExplainPrintCosts (const Json_object *obj, std::string *explain)
 

Additional Inherited Members

- Public Attributes inherited from Explain_format
LEX_CSTRING m_schema_name_for_explain
 
- Protected Member Functions inherited from Explain_format
 Explain_format ()
 
 Explain_format (std::optional< std::string_view > explain_into_variable_name)
 
- Protected Attributes inherited from Explain_format
Query_resultoutput
 output resulting data there More...
 

Constructor & Destructor Documentation

◆ Explain_format_tree()

Explain_format_tree::Explain_format_tree ( )
default

Member Function Documentation

◆ AppendChildren()

void Explain_format_tree::AppendChildren ( const Json_dom children,
int  level,
std::string *  explain,
std::vector< std::string > *  tokens_for_force_subplan,
std::string *  child_token_digest 
)
private

◆ begin_context()

bool Explain_format_tree::begin_context ( enum_parsing_context  context,
Query_expression subquery,
const Explain_format_flags flags 
)
inlineoverridevirtual

Enter a specified context.

Parameters
contextcontext type
subqueryfor CTX_WHERE: unit of the subquery
flagsFormat flags, see Explain_format_flags.

Implements Explain_format.

◆ end_context()

bool Explain_format_tree::end_context ( enum_parsing_context  context)
inlineoverridevirtual

Leave the current context.

Parameters
contextcurrent context type (for validation/debugging)

Implements Explain_format.

◆ entry()

qep_row * Explain_format_tree::entry ( )
inlineoverridevirtual

Get a pointer to the current TABLE/JOIN_TAB property set.

Implements Explain_format.

◆ ExplainJsonToString()

string Explain_format_tree::ExplainJsonToString ( Json_object json)
overridevirtual

Convert Json object to string.

Reimplemented from Explain_format.

◆ ExplainPrintCosts()

void Explain_format_tree::ExplainPrintCosts ( const Json_object obj,
std::string *  explain 
)
private

◆ ExplainPrintTreeNode()

void Explain_format_tree::ExplainPrintTreeNode ( const Json_dom json,
int  level,
std::string *  explain,
std::vector< std::string > *  tokens_for_force_subplan 
)

◆ flush_entry()

bool Explain_format_tree::flush_entry ( )
inlineoverridevirtual

Flush TABLE/JOIN_TAB property set.

For traditional EXPLAIN: output a single EXPLAIN row.

Implements Explain_format.

◆ is_hierarchical()

bool Explain_format_tree::is_hierarchical ( ) const
inlineoverridevirtual

A hierarchical text or a plain table.

Return values
trueFormatter produces hierarchical text
falseTraditional explain

Implements Explain_format.

◆ is_iterator_based()

bool Explain_format_tree::is_iterator_based ( THD explain_thd,
const THD query_thd 
) const
inlineoverridevirtual

Whether the format closely resembles the final plan to be executed by execution iterators (See RowIterator).

These formats share a common logic that uses AccessPath structure to generate the information, so they all display exactly the same information, even though the style of each format might be different.

Note
: The new json format for hypergraph and the tree format are examples of iterator-based formats.
Return values
trueFormat is Iterator-based.
falseFormat is not Iterator-based.

Reimplemented from Explain_format.

◆ push_select_type()

bool Explain_format_tree::push_select_type ( mem_root_deque< Item * > *  items)
private

◆ send_headers()

bool Explain_format_tree::send_headers ( Query_result result)
inlineoverridevirtual

Send EXPLAIN header item(s) to output stream.

Note
: This function caches the output result set pointer for further use.
Parameters
resultoutput result set
Return values
falseOK
trueError

Reimplemented from Explain_format.


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