MySQL 8.0.39
Source Code Documentation
opt_explain_json_namespace Namespace Reference

Classes

class  context
 Base class for all intermediate tree nodes. More...
 
class  duplication_weedout_ctx
 Context class to represent JOIN_TABs in duplication weedout sequence. More...
 
class  join_ctx
 Node class for the CTX_JOIN context. More...
 
class  join_tab_ctx
 Node class for the CTX_QEP_TAB context. More...
 
class  joinable_ctx
 Base for CTX_QEP_TAB, CTX_DUPLICATES_WEEDOUT and CTX_MATERIALIZATION nodes. More...
 
class  materialize_ctx
 Context class to group materialized JOIN_TABs to "materialized" array. More...
 
class  message_ctx
 Node class for CTX_MESSAGE. More...
 
class  setop_ctx
 Node class for UNION, EXCEPT, INTERSECT, UNARY (query expression) More...
 
class  setop_result_ctx
 Node class for the CTX_UNION_RESULT. More...
 
class  simple_sort_ctx
 Base class for CTX_ORDER_BY, CTX_GROUP_BY and node class for CTX_DISTINCT. More...
 
class  simple_sort_with_subqueries_ctx
 Node class for "simple" CTX_ORDER_BY and CTX_GROUP_BY. More...
 
class  sort_ctx
 Node class for CTX_SIMPLE_ORDER_BY, CTX_SIMPLE_GROUP_BY and CTX_SIMPLE_DISTINCT. More...
 
class  sort_with_subqueries_ctx
 
class  subquery_ctx
 Node class to wrap a subquery node tree. More...
 
class  table_base_ctx
 
class  table_with_where_and_derived
 Common part of CTX_QEP_TAB and CTX_MESSAGE nodes. More...
 
class  unit_ctx
 Helper base class to host HAVING, ORDER BY and GROUP BY subquery nodes. More...
 
class  window_ctx
 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: [ ... ]. More...
 

Enumerations

enum  subquery_list_enum {
  SQ_SELECT_LIST , SQ_UPDATE_VALUE , SQ_INSERT_VALUES , SQ_INSERT_UPDATE ,
  SQ_HAVING , SQ_OPTIMIZED_AWAY , SQ_toplevel , SQ_ORDER_BY ,
  SQ_GROUP_BY , SQ_total
}
 

Functions

static bool format_list (Opt_trace_context *json, List< subquery_ctx > &subqueries, const char *name)
 Helper function to pass a subquery list to a JSON formatter. More...
 
static void add_string_array (Opt_trace_context *json, const char *list_name, List< const char > &strings)
 
static void print_cost (char *buf, uint buf_len, double cost)
 
static void print_filtered (char *buf, uint buf_len, double filtered)
 
template<typename T >
static size_t get_id (List< T > &list, bool hide)
 Auxiliary function to walk through the list and propagate "hide" value. More...
 

Variables

static const char * list_names [SQ_total]
 

Enumeration Type Documentation

◆ subquery_list_enum

Note
Keep in sync with the list_names array.
Enumerator
SQ_SELECT_LIST 

SELECT list subqueries.

SQ_UPDATE_VALUE 

UPDATE ... SET field=(subquery)

SQ_INSERT_VALUES 

subqueries in VALUES of INSERT ... VALUES

SQ_INSERT_UPDATE 

subqueries in UPDATE of INSERT ... ON DUPLICATE KEY UPDATE

SQ_HAVING 

HAVING clause subqueries.

SQ_OPTIMIZED_AWAY 

"optimized_away_subqueries"

SQ_toplevel 

SQ array size for unit_ctx.

SQ_ORDER_BY 

ORDER BY clause subqueries.

SQ_GROUP_BY 

GROUP BY clause subqueries.

SQ_total 

Function Documentation

◆ add_string_array()

static void opt_explain_json_namespace::add_string_array ( Opt_trace_context json,
const char *  list_name,
List< const char > &  strings 
)
static

◆ format_list()

static bool opt_explain_json_namespace::format_list ( Opt_trace_context json,
List< subquery_ctx > &  subqueries,
const char *  name 
)
static

Helper function to pass a subquery list to a JSON formatter.

Parameters
jsonoutput formatter
subqueriessubquery list to output
namename for the output section
Return values
falseOk
trueError

◆ get_id()

template<typename T >
static size_t opt_explain_json_namespace::get_id ( List< T > &  list,
bool  hide 
)
static

Auxiliary function to walk through the list and propagate "hide" value.

Parameters
listlist of context (*_ctx) objects
hideif true, ban the output of K_SELECT_ID JSON property in the underlying table_with_where_and_derived_ctx and materialize_ctx objects
Returns
id of underlying objects

◆ print_cost()

static void opt_explain_json_namespace::print_cost ( char *  buf,
uint  buf_len,
double  cost 
)
static

◆ print_filtered()

static void opt_explain_json_namespace::print_filtered ( char *  buf,
uint  buf_len,
double  filtered 
)
static

Variable Documentation

◆ list_names

const char* opt_explain_json_namespace::list_names[SQ_total]
static
Initial value:
= {
"",
}
static const char K_HAVING_SUBQUERIES[]
Definition: opt_explain_json.cc:116
static const char K_INSERT_UPDATE_SUBQUERIES[]
Definition: opt_explain_json.cc:118
static const char K_INSERT_VALUES_SUBQUERIES[]
Definition: opt_explain_json.cc:117
static const char K_UPDATE_VALUE_SUBQUERIES[]
Definition: opt_explain_json.cc:143
static const char K_SELECT_LIST_SUBQUERIES[]
Definition: opt_explain_json.cc:135
static const char K_OPTIMIZED_AWAY_SUBQUERIES[]
Definition: opt_explain_json.cc:125
static const char K_GROUP_BY_SUBQUERIES[]
Definition: opt_explain_json.cc:115
static const char K_ORDER_BY_SUBQUERIES[]
Definition: opt_explain_json.cc:128
Note
Keep in sync with subquery_list_enum.