24#ifndef OPT_EXPLAIN_FORMAT_INCLUDED
25#define OPT_EXPLAIN_FORMAT_INCLUDED
167 template <
typename T>
213 bool set(
const char *str_arg) {
return set(str_arg, strlen(str_arg)); }
223 bool set(
const char *str_arg,
size_t length_arg);
242 return set_const(str_arg, strlen(str_arg));
244 void set_const(
const char *str_arg,
size_t length_arg) {
251 if (len == 0 ||
str ==
nullptr)
return const_cast<char *
>(
"");
252 if (
str[len - 1] == 0)
255 char *ret =
static_cast<char *
>(root->
Alloc(len + 1));
256 if (ret !=
nullptr) {
257 memcpy(ret,
str, len);
281 :
tag(tag_arg),
data(data_arg) {}
475 sorts[clause] &= ~property;
482 return sorts[clause] & property;
496 if (i != clause && (
sorts[i] & property))
return true;
554 const THD *query_thd [[maybe_unused]])
const {
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Represents a JSON container value of type "object" (ECMA), type J_OBJECT here.
Definition: json_dom.h:367
Emulate lazy computation.
Definition: opt_explain_format.h:105
virtual bool eval(String *ret)=0
Deferred evaluation of encapsulated expression.
Definition: sql_list.h:494
A JSON object (unordered set of key/value pairs).
Definition: opt_trace.h:802
This class represents a query expression (one query block or several query blocks combined with UNION...
Definition: sql_lex.h:627
Definition: query_result.h:58
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
const char * ptr() const
Definition: sql_string.h:249
size_t length() const
Definition: sql_string.h:241
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Represents the (explicit) window of a SQL 2003 section 7.11 <window clause>, or the implicit (inlined...
Definition: window.h:110
Base class for all intermediate tree nodes.
Definition: opt_explain_json.cc:220
Helper class for table property buffering.
Definition: opt_explain_format.h:150
List< const char > col_partial_update_columns
List of columns that can be updated using partial update.
Definition: opt_explain_format.h:327
List< const char > col_partitions
"partitions" column
Definition: opt_explain_format.h:293
void format_extra(Opt_trace_object *obj)
Definition: opt_explain_json.cc:2095
mem_root_str col_message
replaces "Extra" column if not empty
Definition: opt_explain_format.h:306
List< extra > col_extra
"extra" column (traditional) or property list
Definition: opt_explain_format.h:303
void cleanup()
Definition: opt_explain_format.h:365
qep_row & operator=(const qep_row &x)
List< const char > col_possible_keys
"possible_keys": comma-separated list
Definition: opt_explain_format.h:296
mem_root_str col_attached_condition
former "Using where"
Definition: opt_explain_format.h:307
enum_mod_type mod_type
Definition: opt_explain_format.h:342
mem_root_str col_join_type
"type" column, see join_type_str array
Definition: opt_explain_format.h:294
mem_root_str col_key_len
"key_length" column: length of the "key" above
Definition: opt_explain_format.h:299
column< double > col_prefix_cost
Cost of the partial join including this table.
Definition: opt_explain_format.h:316
column< ulonglong > col_rows
"rows": estimated number of examined table rows per single scan
Definition: opt_explain_format.h:310
column< double > col_read_cost
Time to read the table.
Definition: opt_explain_format.h:314
column< float > col_filtered
"filtered": % of rows filtered by condition
Definition: opt_explain_format.h:302
List< const char > col_key_parts
used parts of the key
Definition: opt_explain_format.h:337
List< const char > col_used_columns
List of used columns.
Definition: opt_explain_format.h:324
column< uint > col_id
"id" column: seq. number of SELECT within the query
Definition: opt_explain_format.h:290
List< const char > col_ref
"ref":columns/constants which are compared to "key"
Definition: opt_explain_format.h:301
qep_row()
Definition: opt_explain_format.h:353
column< ulonglong > col_prefix_rows
"rows": estimated number of examined table rows per query
Definition: opt_explain_format.h:312
mem_root_str col_key
"key" column: index that is actually decided to use
Definition: opt_explain_format.h:298
bool using_temporary
Definition: opt_explain_format.h:341
virtual void register_where_subquery(Query_expression *subquery)
Remember a subquery's unit.
Definition: opt_explain_format.h:417
bool is_dependent
Definition: opt_explain_format.h:339
List< opt_explain_json_namespace::context > derived_from
List of "derived" subquery trees.
Definition: opt_explain_format.h:335
uint derived_clone_id
If a clone of a materialized derived table, this is the ID of the first underlying query block of the...
Definition: opt_explain_format.h:349
uint query_block_id
query block id for materialized subqueries
Definition: opt_explain_format.h:330
column< enum_explain_type > col_select_type
"select_type" column
Definition: opt_explain_format.h:291
bool is_cacheable
Definition: opt_explain_format.h:340
mem_root_str col_table_name
"table" to which the row of output refers
Definition: opt_explain_format.h:292
virtual ~qep_row()=default
column< double > col_cond_cost
Cost of evaluating conditions on this table per query.
Definition: opt_explain_format.h:318
List< Window > * m_windows
Windows to describe in this node.
Definition: opt_explain_format.h:351
qep_row(const qep_row &x)
bool is_materialized_from_subquery
Definition: opt_explain_format.h:343
mem_root_str col_data_size_query
Size of data expected to be read per query.
Definition: opt_explain_format.h:321
enum_explain_type
Query_block type enum.
Definition: sql_lex.h:1134
void * memdup_root(MEM_ROOT *root, const void *str, size_t len)
Definition: my_alloc.cc:296
static int flags[50]
Definition: hp_test1.cc:40
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
Header for compiler-dependent features.
Some integer typedefs for easier portability.
uint8_t uint8
Definition: my_inttypes.h:63
Common header for many mysys elements.
Definition: opt_explain_format.h:133
enum_parsing_context
Names for different query parse tree parts.
Definition: parse_tree_node_base.h:61
struct result result
Definition: result.h:34
Our own string classes, used pervasively throughout the executor.
Base class for all EXPLAIN context descriptor classes.
Definition: opt_explain_format.h:126
enum_parsing_context type
type tag
Definition: opt_explain_format.h:127
Explain_context(enum_parsing_context type_arg)
Definition: opt_explain_format.h:129
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
void * Alloc(size_t length)
Allocate memory.
Definition: my_alloc.h:145
Definition: mysql_lex_string.h:40
size_t length
Definition: mysql_lex_string.h:42
A wrapper for numeric table properties.
Definition: opt_explain_format.h:168
column()
Definition: opt_explain_format.h:175
bool nil
true if the column contains NULL
Definition: opt_explain_format.h:170
T get() const
Definition: opt_explain_format.h:182
void set(T value_arg)
Definition: opt_explain_format.h:178
T value
Definition: opt_explain_format.h:172
bool is_empty() const
Definition: opt_explain_format.h:176
void cleanup()
Definition: opt_explain_format.h:177
Helper class to keep string data in MEM_ROOT before passing to Item_string.
Definition: opt_explain_format.h:200
size_t length
Definition: opt_explain_format.h:202
void cleanup()
Definition: opt_explain_format.h:207
void set_const(const char *str_arg, size_t length_arg)
Definition: opt_explain_format.h:244
bool set(const char *str_arg)
Definition: opt_explain_format.h:213
void set_const(const char *str_arg)
Make a copy of string constant.
Definition: opt_explain_format.h:241
void set(Lazy *x)
Save expression for further evaluation.
Definition: opt_explain_format.h:230
static char * strndup_root(MEM_ROOT *root, const char *str, size_t len)
Definition: opt_explain_format.h:250
Lazy * deferred
encapsulated expression to evaluate it later (on demand)
Definition: opt_explain_format.h:204
bool is_empty()
Definition: opt_explain_format.cc:32
mem_root_str()
Definition: opt_explain_format.h:206
const char * str
Definition: opt_explain_format.h:201
bool set(const String &s)
Definition: opt_explain_format.h:214