MySQL 8.0.39
Source Code Documentation
opt_explain_json_namespace::context Class Referenceabstract

Base class for all intermediate tree nodes. More...

Inheritance diagram for opt_explain_json_namespace::context:
[legend]

Public Member Functions

 context (enum_parsing_context type_arg, const char *name_arg, context *parent_arg)
 
virtual ~context ()=default
 
virtual bool format (Opt_trace_context *json)
 Pass the node with its child nodes to a JSON formatter. More...
 
bool is_query_block () const
 
virtual size_t id (bool hide=false)=0
 Analogue of the "id" column in the traditional EXPLAIN output. More...
 
virtual bool cacheable ()
 
virtual bool dependent ()
 
virtual class qep_rowentry ()
 
virtual enum_mod_type get_mod_type ()
 
virtual void set_child (context *)
 Associate a child node with this node. More...
 
virtual void set_setop_result (setop_result_ctx *)
 associate CTX_UNION_RESULT node with CTX_UNION node More...
 
virtual bool add_subquery (subquery_list_enum subquery_type, subquery_ctx *ctx)
 Append a subquery node to the specified list of the unit node. More...
 
virtual bool format_nested_loop (Opt_trace_context *json)
 Format nested loop join subtree (if any) to JSON formatter. More...
 
virtual bool add_join_tab (joinable_ctx *ctx)
 Add a CTX_QEP_TAB node to a CTX_JOIN node. More...
 
virtual void set_sort (sort_ctx *ctx)
 Set nested ORDER BY/GROUP BY/DISTINCT node to ctx. More...
 
virtual void set_window (window_ctx *ctx)
 Set nested WINDOW node to ctx. More...
 
virtual bool add_query_spec (context *ctx)
 Add a query specification node to the CTX_UNION node. More...
 
virtual bool find_and_set_derived (context *subquery)
 Try to associate a derived subquery node with this or underlying node. More...
 
virtual int add_where_subquery (subquery_ctx *ctx, Query_expression *subquery)
 Associate WHERE subqueries of given context and unit with this object. More...
 
virtual bool format_derived (Opt_trace_context *)
 Helper function to format output for derived subquery if any. More...
 
virtual bool format_where (Opt_trace_context *)
 Helper function to format output for associated WHERE subqueries if any. More...
 
virtual bool format_query_expression (Opt_trace_context *)
 Helper function to format output for HAVING, ORDER/GROUP BY subqueries. More...
 
- Public Member Functions inherited from Explain_context
 Explain_context (enum_parsing_context type_arg)
 

Public Attributes

contextparent
 link to parent node or NULL More...
 
- Public Attributes inherited from Explain_context
enum_parsing_context type
 type tag More...
 

Protected Attributes

const char * name
 

Private Member Functions

virtual bool format_body (Opt_trace_context *json, Opt_trace_object *obj)=0
 Format JSON object body. More...
 

Detailed Description

Base class for all intermediate tree nodes.

Constructor & Destructor Documentation

◆ context()

opt_explain_json_namespace::context::context ( enum_parsing_context  type_arg,
const char *  name_arg,
context parent_arg 
)
inline

◆ ~context()

virtual opt_explain_json_namespace::context::~context ( )
virtualdefault

Member Function Documentation

◆ add_join_tab()

virtual bool opt_explain_json_namespace::context::add_join_tab ( joinable_ctx ctx)
inlinevirtual

◆ add_query_spec()

virtual bool opt_explain_json_namespace::context::add_query_spec ( context ctx)
inlinevirtual

Add a query specification node to the CTX_UNION node.

Parameters
ctxquery specification node
Return values
falseOk
trueError

Reimplemented in opt_explain_json_namespace::setop_ctx.

◆ add_subquery()

virtual bool opt_explain_json_namespace::context::add_subquery ( subquery_list_enum  subquery_type,
subquery_ctx ctx 
)
inlinevirtual

Append a subquery node to the specified list of the unit node.

Parameters
subquery_typeDescribes the Item tree where the subquery exists
ctxSubquery node
Return values
falseOk
trueError

Reimplemented in opt_explain_json_namespace::unit_ctx, opt_explain_json_namespace::setop_result_ctx, opt_explain_json_namespace::join_ctx, opt_explain_json_namespace::materialize_ctx, opt_explain_json_namespace::duplication_weedout_ctx, opt_explain_json_namespace::simple_sort_with_subqueries_ctx, and opt_explain_json_namespace::sort_with_subqueries_ctx.

◆ add_where_subquery()

virtual int opt_explain_json_namespace::context::add_where_subquery ( subquery_ctx ctx,
Query_expression subquery 
)
inlinevirtual

Associate WHERE subqueries of given context and unit with this object.

Parameters
ctxContext of WHERE subquery
subqueryFor CTX_QEP_TAB: match given unit with a previously collected by the register_where_subquery function.
Returns
-1 subquery wasn't found 0 subqusery were added 1 error occurred

Reimplemented in opt_explain_json_namespace::message_ctx, opt_explain_json_namespace::join_tab_ctx, opt_explain_json_namespace::simple_sort_ctx, opt_explain_json_namespace::join_ctx, opt_explain_json_namespace::materialize_ctx, and opt_explain_json_namespace::duplication_weedout_ctx.

◆ cacheable()

◆ dependent()

◆ entry()

◆ find_and_set_derived()

virtual bool opt_explain_json_namespace::context::find_and_set_derived ( context subquery)
inlinevirtual

Try to associate a derived subquery node with this or underlying node.

Parameters
subqueryDerived subquery node
Return values
trueSuccess
falseCan't associate: this node or its child nodes are not derived from the subquery

Reimplemented in opt_explain_json_namespace::message_ctx, opt_explain_json_namespace::join_tab_ctx, opt_explain_json_namespace::simple_sort_ctx, opt_explain_json_namespace::join_ctx, opt_explain_json_namespace::materialize_ctx, and opt_explain_json_namespace::duplication_weedout_ctx.

◆ format()

virtual bool opt_explain_json_namespace::context::format ( Opt_trace_context json)
inlinevirtual

Pass the node with its child nodes to a JSON formatter.

Parameters
jsonFormatter
Return values
falseOk
trueError
Note
The join_ctx class overloads this function.

Reimplemented in opt_explain_json_namespace::subquery_ctx, and opt_explain_json_namespace::setop_result_ctx.

◆ format_body()

◆ format_derived()

virtual bool opt_explain_json_namespace::context::format_derived ( Opt_trace_context )
inlinevirtual

Helper function to format output for derived subquery if any.

Reimplemented in opt_explain_json_namespace::table_with_where_and_derived, opt_explain_json_namespace::message_ctx, and opt_explain_json_namespace::join_tab_ctx.

◆ format_nested_loop()

virtual bool opt_explain_json_namespace::context::format_nested_loop ( Opt_trace_context json)
inlinevirtual

Format nested loop join subtree (if any) to JSON formatter.

Parameters
jsonFormatter
Return values
falseOk
trueError

Reimplemented in opt_explain_json_namespace::join_ctx, opt_explain_json_namespace::materialize_ctx, and opt_explain_json_namespace::duplication_weedout_ctx.

◆ format_query_expression()

virtual bool opt_explain_json_namespace::context::format_query_expression ( Opt_trace_context )
inlinevirtual

◆ format_where()

virtual bool opt_explain_json_namespace::context::format_where ( Opt_trace_context )
inlinevirtual

Helper function to format output for associated WHERE subqueries if any.

Reimplemented in opt_explain_json_namespace::table_with_where_and_derived, opt_explain_json_namespace::message_ctx, and opt_explain_json_namespace::join_tab_ctx.

◆ get_mod_type()

virtual enum_mod_type opt_explain_json_namespace::context::get_mod_type ( )
inlinevirtual

◆ id()

virtual size_t opt_explain_json_namespace::context::id ( bool  hide = false)
pure virtual

◆ is_query_block()

bool opt_explain_json_namespace::context::is_query_block ( ) const
inline

◆ set_child()

virtual void opt_explain_json_namespace::context::set_child ( context )
inlinevirtual

Associate a child node with this node.

This function is to be overloaded by subquery_ctx.

Reimplemented in opt_explain_json_namespace::subquery_ctx.

◆ set_setop_result()

virtual void opt_explain_json_namespace::context::set_setop_result ( setop_result_ctx )
inlinevirtual

associate CTX_UNION_RESULT node with CTX_UNION node

Reimplemented in opt_explain_json_namespace::setop_ctx.

◆ set_sort()

virtual void opt_explain_json_namespace::context::set_sort ( sort_ctx ctx)
inlinevirtual

◆ set_window()

virtual void opt_explain_json_namespace::context::set_window ( window_ctx ctx)
inlinevirtual

Member Data Documentation

◆ name

const char* opt_explain_json_namespace::context::name
protected

◆ parent

context* opt_explain_json_namespace::context::parent

link to parent node or NULL


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