MySQL  8.0.20
Source Code Documentation
opt_explain_json_namespace::window_ctx Class Reference

When the query has window functions, an outer node named "windowing" is added: query_block: { select_id: 1, windowing: { windows: [ ... More...

Inheritance diagram for opt_explain_json_namespace::window_ctx:
opt_explain_json_namespace::join_ctx opt_explain_json_namespace::unit_ctx qep_row opt_explain_json_namespace::context Explain_context

Public Member Functions

 window_ctx (context *parent_arg)
 
- Public Member Functions inherited from opt_explain_json_namespace::join_ctx
 join_ctx (enum_parsing_context type_arg, const char *name_arg, context *parent_arg)
 
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 qep_rowentry ()
 
virtual bool find_and_set_derived (context *subquery)
 Associate a CTX_DERIVED node with its CTX_QEP_TAB 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 size_t id (bool hide)
 Analogue of the "id" column in the traditional EXPLAIN output. More...
 
virtual bool cacheable ()
 
virtual bool dependent ()
 
virtual int add_where_subquery (subquery_ctx *ctx, SELECT_LEX_UNIT *subquery)
 Associate WHERE subqueries of given context and unit with this object. More...
 
- Public Member Functions inherited from opt_explain_json_namespace::unit_ctx
 unit_ctx (enum_parsing_context type_arg, const char *name_arg, context *parent_arg)
 
bool has_no_subqueries () const
 Helper function to distinguish subquery-less nodes. More...
 
virtual bool format_unit (Opt_trace_context *json)
 Helper function to format output for HAVING, ORDER/GROUP BY subqueries. More...
 
- 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 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_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...
 
- Public Member Functions inherited from Explain_context
 Explain_context (enum_parsing_context type_arg)
 
- Public Member Functions inherited from qep_row
 qep_row ()
 
virtual ~qep_row ()
 
void cleanup ()
 
virtual void register_where_subquery (SELECT_LEX_UNIT *subquery)
 Remember a subquery's unit. More...
 
void format_extra (Opt_trace_object *obj)
 

Protected Member Functions

const char * get_cost_tag ()
 
- Protected Member Functions inherited from opt_explain_json_namespace::join_ctx
bool format_body_inner (Opt_trace_context *json, Opt_trace_object *obj)
 

Private Member Functions

virtual bool format_body (Opt_trace_context *json, Opt_trace_object *obj)
 Format JSON object body. 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...
 
- Public Attributes inherited from qep_row
column< uintcol_id
 "id" column: seq. number of SELECT withing the query More...
 
column< enum_explain_typecol_select_type
 "select_type" column More...
 
mem_root_str col_table_name
 "table" to which the row of output refers More...
 
List< const char > col_partitions
 "partitions" column More...
 
mem_root_str col_join_type
 "type" column, see join_type_str array More...
 
List< const char > col_possible_keys
 "possible_keys": comma-separated list More...
 
mem_root_str col_key
 "key" column: index that is actually decided to use More...
 
mem_root_str col_key_len
 "key_length" column: length of the "key" above More...
 
List< const char > col_ref
 "ref":columns/constants which are compared to "key" More...
 
column< float > col_filtered
 "filtered": % of rows filtered by condition More...
 
List< extracol_extra
 "extra" column (traditional) or property list More...
 
mem_root_str col_message
 replaces "Extra" column if not empty More...
 
mem_root_str col_attached_condition
 former "Using where" More...
 
column< ulonglongcol_rows
 "rows": estimated number of examined table rows per single scan More...
 
column< ulonglongcol_prefix_rows
 "rows": estimated number of examined table rows per query More...
 
column< double > col_read_cost
 Time to read the table. More...
 
column< double > col_prefix_cost
 Cost of the partial join including this table. More...
 
column< double > col_cond_cost
 Cost of evaluating conditions on this table per query. More...
 
mem_root_str col_data_size_query
 Size of data expected to be read per query. More...
 
List< const char > col_used_columns
 List of used columns. More...
 
List< const char > col_partial_update_columns
 List of columns that can be updated using partial update. More...
 
uint query_block_id
 query block id for materialized subqueries More...
 
List< opt_explain_json_namespace::contextderived_from
 List of "derived" subquery trees. More...
 
List< const char > col_key_parts
 used parts of the key More...
 
bool is_dependent
 
bool is_cacheable
 
bool using_temporary
 
enum_mod_type mod_type
 
bool is_materialized_from_subquery
 
uint derived_clone_id
 If a clone of a materialized derived table, this is the ID of the first underlying query block of the first materialized derived table. More...
 
List< Window > * m_windows
 Windows to describe in this node. More...
 
- Protected Attributes inherited from opt_explain_json_namespace::join_ctx
List< joinable_ctxjoin_tabs
 hosted JOIN_TAB nodes More...
 
sort_ctxsort
 
window_ctxwindow
 
- Protected Attributes inherited from opt_explain_json_namespace::context
const char * name
 

Detailed Description

When the query has window functions, an outer node named "windowing" is added: query_block: { select_id: 1, windowing: { windows: [ ...

list of all windows' details ... ], nested_loop: [ ... ]

Due to this "outer-node" layout, the implementation of window_ctx is similar to that of sort_ctx. Except that while it makes sense to describe to the user the "subqueries included in ORDER BY", it doesn't for "subqueries included in the window function's arguments" (the window function belongs to the SELECT list or ORDER BY: so does the subquery, simply), so there is no window_with_subqueries_ctx.

Constructor & Destructor Documentation

◆ window_ctx()

opt_explain_json_namespace::window_ctx::window_ctx ( context parent_arg)
inline

Member Function Documentation

◆ format_body()

virtual bool opt_explain_json_namespace::window_ctx::format_body ( Opt_trace_context json,
Opt_trace_object obj 
)
inlineprivatevirtual

Format JSON object body.

Parameters
jsonFormatter
objObject of this body
Return values
falseOk
trueError

Reimplemented from opt_explain_json_namespace::join_ctx.

◆ get_cost_tag()

const char* opt_explain_json_namespace::window_ctx::get_cost_tag ( )
inlineprotectedvirtual

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