MySQL  8.0.19
Source Code Documentation
opt_explain_json_namespace::simple_sort_ctx Class Reference

Base class for CTX_ORDER_BY, CTX_GROUP_BY and node class for CTX_DISTINCT. More...

Inheritance diagram for opt_explain_json_namespace::simple_sort_ctx:
opt_explain_json_namespace::joinable_ctx opt_explain_json_namespace::context Explain_context opt_explain_json_namespace::simple_sort_with_subqueries_ctx

Public Member Functions

 simple_sort_ctx (enum_parsing_context type_arg, const char *name_arg, context *parent_arg, const Explain_format_flags *flags, Explain_sort_clause clause)
 
virtual bool add_join_tab (joinable_ctx *ctx)
 Add a CTX_QEP_TAB node to a CTX_JOIN node. More...
 
virtual int add_where_subquery (subquery_ctx *ctx, SELECT_LEX_UNIT *subquery)
 Associate WHERE subqueries of given context and unit with this object. More...
 
virtual bool find_and_set_derived (context *subquery)
 Try to associate a derived subquery node with this or underlying node. More...
 
virtual size_t id (bool hide)
 Analogue of the "id" column in the traditional EXPLAIN output. More...
 
virtual bool cacheable ()
 
virtual bool dependent ()
 
- Public Member Functions inherited from opt_explain_json_namespace::joinable_ctx
 joinable_ctx (enum_parsing_context type_arg, const char *name_arg, context *parent_arg)
 
- Public Member Functions inherited from opt_explain_json_namespace::context
 context (enum_parsing_context type_arg, const char *name_arg, context *parent_arg)
 
virtual ~context ()
 
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 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_union_result (union_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 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 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_unit (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)
 

Protected Member Functions

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

Protected Attributes

joinable_ctxjoin_tab
 Single JOIN_TAB that we sort. More...
 
- Protected Attributes inherited from opt_explain_json_namespace::context
const char * name
 

Private Attributes

const bool using_tmptable
 True if the clause creates intermediate table. More...
 
const bool using_filesort
 True if the clause uses filesort. More...
 

Additional Inherited Members

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

Detailed Description

Base class for CTX_ORDER_BY, CTX_GROUP_BY and node class for CTX_DISTINCT.

This class represents context for simple ORDER BY/GROUP BY/DISTINCT clauses (the clause is effective for the single JOIN_TAB).

Constructor & Destructor Documentation

◆ simple_sort_ctx()

opt_explain_json_namespace::simple_sort_ctx::simple_sort_ctx ( enum_parsing_context  type_arg,
const char *  name_arg,
context parent_arg,
const Explain_format_flags flags,
Explain_sort_clause  clause 
)
inline

Member Function Documentation

◆ add_join_tab()

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

Add a CTX_QEP_TAB node to a CTX_JOIN node.

Parameters
ctxCTX_QEP_TAB node
Return values
falseOk
trueError

Reimplemented from opt_explain_json_namespace::context.

◆ add_where_subquery()

virtual int opt_explain_json_namespace::simple_sort_ctx::add_where_subquery ( subquery_ctx ctx,
SELECT_LEX_UNIT 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 from opt_explain_json_namespace::context.

◆ cacheable()

virtual bool opt_explain_json_namespace::simple_sort_ctx::cacheable ( )
inlinevirtual

◆ dependent()

virtual bool opt_explain_json_namespace::simple_sort_ctx::dependent ( )
inlinevirtual

◆ find_and_set_derived()

virtual bool opt_explain_json_namespace::simple_sort_ctx::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 from opt_explain_json_namespace::context.

◆ format_body()

virtual bool opt_explain_json_namespace::simple_sort_ctx::format_body ( Opt_trace_context json,
Opt_trace_object obj 
)
inlineprotectedvirtual

Format JSON object body.

Parameters
jsonFormatter
objObject of this body
Return values
falseOk
trueError

Implements opt_explain_json_namespace::context.

Reimplemented in opt_explain_json_namespace::simple_sort_with_subqueries_ctx.

◆ id()

virtual size_t opt_explain_json_namespace::simple_sort_ctx::id ( bool  hide)
inlinevirtual

Analogue of the "id" column in the traditional EXPLAIN output.

Parameters
hideif true, ban the output of K_SELECT_ID JSON property in the underlying table_with_where_and_derived_ctx objects
Returns
"Select number" that is associated with this node

Implements opt_explain_json_namespace::context.

Member Data Documentation

◆ join_tab

joinable_ctx* opt_explain_json_namespace::simple_sort_ctx::join_tab
protected

Single JOIN_TAB that we sort.

◆ using_filesort

const bool opt_explain_json_namespace::simple_sort_ctx::using_filesort
private

True if the clause uses filesort.

◆ using_tmptable

const bool opt_explain_json_namespace::simple_sort_ctx::using_tmptable
private

True if the clause creates intermediate table.


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