MySQL 9.1.0
Source Code Documentation
opt_explain_json_namespace::join_tab_ctx Class Reference

Node class for the CTX_QEP_TAB context. More...

Inheritance diagram for opt_explain_json_namespace::join_tab_ctx:
[legend]

Public Member Functions

 join_tab_ctx (enum_parsing_context type_arg, context *parent_arg)
 
bool format_body (Opt_trace_context *json, Opt_trace_object *obj) override
 Format JSON object body. More...
 
size_t id (bool hide) override
 Analogue of the "id" column in the traditional EXPLAIN output. More...
 
bool cacheable () override
 
bool dependent () override
 
qep_rowentry () override
 
bool format_derived (Opt_trace_context *json) override
 Helper function to format output for derived subquery if any. More...
 
bool format_where (Opt_trace_context *json) override
 Helper function to format output for associated WHERE subqueries if any. More...
 
void register_where_subquery (Query_expression *subquery) override
 Remember a subquery's unit. More...
 
int add_where_subquery (subquery_ctx *ctx, Query_expression *subquery) override
 Associate WHERE subqueries of given context and unit with this object. More...
 
bool find_and_set_derived (context *subquery) override
 Try to associate a derived subquery node with this or underlying node. More...
 
enum_mod_type get_mod_type () override
 
- 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 ()=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 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 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 Member Functions inherited from opt_explain_json_namespace::table_with_where_and_derived
 table_with_where_and_derived (enum_parsing_context type_arg, const char *name_arg, context *parent_arg)
 
- Public Member Functions inherited from opt_explain_json_namespace::table_base_ctx
 table_base_ctx (enum_parsing_context type_arg, const char *name_arg, context *parent_arg)
 
- Public Member Functions inherited from qep_row
 qep_row ()
 
virtual ~qep_row ()=default
 
void cleanup ()
 
void format_extra (Opt_trace_object *obj)
 

Private Attributes

List< Query_expressionwhere_subquery_units
 Subquery units that are associated with this JOIN_TAB's condition. 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 opt_explain_json_namespace::table_with_where_and_derived
List< subquery_ctxwhere_subqueries
 associated WHERE clause subqueries More...
 
- Public Attributes inherited from qep_row
column< uint > col_id
 "id" column: seq. number of SELECT within 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::context
const char * name
 
- Protected Attributes inherited from opt_explain_json_namespace::table_base_ctx
bool is_hidden_id
 if true, don't output K_SELECT_ID property More...
 

Detailed Description

Node class for the CTX_QEP_TAB context.

Constructor & Destructor Documentation

◆ join_tab_ctx()

opt_explain_json_namespace::join_tab_ctx::join_tab_ctx ( enum_parsing_context  type_arg,
context parent_arg 
)
inline

Member Function Documentation

◆ add_where_subquery()

int opt_explain_json_namespace::join_tab_ctx::add_where_subquery ( subquery_ctx ctx,
Query_expression subquery 
)
inlineoverridevirtual

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()

bool opt_explain_json_namespace::join_tab_ctx::cacheable ( )
inlineoverridevirtual

◆ dependent()

bool opt_explain_json_namespace::join_tab_ctx::dependent ( )
inlineoverridevirtual

◆ entry()

qep_row * opt_explain_json_namespace::join_tab_ctx::entry ( )
inlineoverridevirtual

◆ find_and_set_derived()

bool opt_explain_json_namespace::join_tab_ctx::find_and_set_derived ( context subquery)
inlineoverridevirtual

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()

bool opt_explain_json_namespace::join_tab_ctx::format_body ( Opt_trace_context json,
Opt_trace_object obj 
)
inlineoverridevirtual

Format JSON object body.

Parameters
jsonFormatter
objObject of this body
Return values
falseOk
trueError

Implements opt_explain_json_namespace::context.

◆ format_derived()

bool opt_explain_json_namespace::join_tab_ctx::format_derived ( Opt_trace_context )
inlineoverridevirtual

Helper function to format output for derived subquery if any.

Reimplemented from opt_explain_json_namespace::table_with_where_and_derived.

◆ format_where()

bool opt_explain_json_namespace::join_tab_ctx::format_where ( Opt_trace_context )
inlineoverridevirtual

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

Reimplemented from opt_explain_json_namespace::table_with_where_and_derived.

◆ get_mod_type()

enum_mod_type opt_explain_json_namespace::join_tab_ctx::get_mod_type ( )
inlineoverridevirtual

◆ id()

size_t opt_explain_json_namespace::join_tab_ctx::id ( bool  hide)
inlineoverridevirtual

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

Reimplemented from opt_explain_json_namespace::table_with_where_and_derived.

◆ register_where_subquery()

void opt_explain_json_namespace::join_tab_ctx::register_where_subquery ( Query_expression subquery)
inlineoverridevirtual

Remember a subquery's unit.

JOIN_TAB inside a JOIN, a table in a join-less query (single-table UPDATE/DELETE) or a table that's optimized out may have a WHERE condition. We create the Explain_context of such a JOIN_TAB or table when the Explain_context objects of its in-WHERE subqueries don't exist. This function collects unit pointers of WHERE subqueries that are associated with the current JOIN_TAB or table. Then we can match these units with units of newly-created Explain_context objects of WHERE subqueries.

Parameters
subqueryWHERE clause subquery's unit

Reimplemented from qep_row.

Member Data Documentation

◆ where_subquery_units

List<Query_expression> opt_explain_json_namespace::join_tab_ctx::where_subquery_units
private

Subquery units that are associated with this JOIN_TAB's condition.

This list is used to match with the subquery parameter of the add_where_subquery function.


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