24#ifndef OPT_EXPLAIN_FORMAT_INCLUDED
25#define OPT_EXPLAIN_FORMAT_INCLUDED
165 template <
typename T>
211 bool set(
const char *str_arg) {
return set(str_arg, strlen(str_arg)); }
221 bool set(
const char *str_arg,
size_t length_arg);
240 return set_const(str_arg, strlen(str_arg));
242 void set_const(
const char *str_arg,
size_t length_arg) {
249 if (len == 0 ||
str ==
nullptr)
return const_cast<char *
>(
"");
250 if (
str[len - 1] == 0)
253 char *ret =
static_cast<char *
>(root->
Alloc(len + 1));
254 if (ret !=
nullptr) {
255 memcpy(ret,
str, len);
279 :
tag(tag_arg),
data(data_arg) {}
473 sorts[clause] &= ~property;
480 return sorts[clause] & property;
494 if (i != clause && (
sorts[i] & property))
return true;
Represents a JSON container value of type "object" (ECMA), type J_OBJECT here.
Definition: json_dom.h:373
Emulate lazy computation.
Definition: opt_explain_format.h:103
virtual bool eval(String *ret)=0
Deferred evaluation of encapsulated expression.
Definition: sql_list.h:434
A JSON object (unordered set of key/value pairs).
Definition: opt_trace.h:799
This class represents a query expression (one query block or several query blocks combined with UNION...
Definition: sql_lex.h:623
Definition: query_result.h:54
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
const char * ptr() const
Definition: sql_string.h:250
size_t length() const
Definition: sql_string.h:242
Represents the (explicit) window of a SQL 2003 section 7.11 <window clause>, or the implicit (inlined...
Definition: window.h:105
Base class for all intermediate tree nodes.
Definition: opt_explain_json.cc:220
Helper class for table property buffering.
Definition: opt_explain_format.h:148
List< const char > col_partial_update_columns
List of columns that can be updated using partial update.
Definition: opt_explain_format.h:325
List< const char > col_partitions
"partitions" column
Definition: opt_explain_format.h:291
void format_extra(Opt_trace_object *obj)
Definition: opt_explain_json.cc:2093
mem_root_str col_message
replaces "Extra" column if not empty
Definition: opt_explain_format.h:304
List< extra > col_extra
"extra" column (traditional) or property list
Definition: opt_explain_format.h:301
void cleanup()
Definition: opt_explain_format.h:363
qep_row & operator=(const qep_row &x)
List< const char > col_possible_keys
"possible_keys": comma-separated list
Definition: opt_explain_format.h:294
mem_root_str col_attached_condition
former "Using where"
Definition: opt_explain_format.h:305
enum_mod_type mod_type
Definition: opt_explain_format.h:340
mem_root_str col_join_type
"type" column, see join_type_str array
Definition: opt_explain_format.h:292
mem_root_str col_key_len
"key_length" column: length of the "key" above
Definition: opt_explain_format.h:297
column< double > col_prefix_cost
Cost of the partial join including this table.
Definition: opt_explain_format.h:314
column< ulonglong > col_rows
"rows": estimated number of examined table rows per single scan
Definition: opt_explain_format.h:308
column< double > col_read_cost
Time to read the table.
Definition: opt_explain_format.h:312
column< float > col_filtered
"filtered": % of rows filtered by condition
Definition: opt_explain_format.h:300
List< const char > col_key_parts
used parts of the key
Definition: opt_explain_format.h:335
List< const char > col_used_columns
List of used columns.
Definition: opt_explain_format.h:322
column< uint > col_id
"id" column: seq. number of SELECT within the query
Definition: opt_explain_format.h:288
List< const char > col_ref
"ref":columns/constants which are compared to "key"
Definition: opt_explain_format.h:299
qep_row()
Definition: opt_explain_format.h:351
column< ulonglong > col_prefix_rows
"rows": estimated number of examined table rows per query
Definition: opt_explain_format.h:310
mem_root_str col_key
"key" column: index that is actually decided to use
Definition: opt_explain_format.h:296
bool using_temporary
Definition: opt_explain_format.h:339
virtual void register_where_subquery(Query_expression *subquery)
Remember a subquery's unit.
Definition: opt_explain_format.h:415
bool is_dependent
Definition: opt_explain_format.h:337
List< opt_explain_json_namespace::context > derived_from
List of "derived" subquery trees.
Definition: opt_explain_format.h:333
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:347
uint query_block_id
query block id for materialized subqueries
Definition: opt_explain_format.h:328
column< enum_explain_type > col_select_type
"select_type" column
Definition: opt_explain_format.h:289
bool is_cacheable
Definition: opt_explain_format.h:338
mem_root_str col_table_name
"table" to which the row of output refers
Definition: opt_explain_format.h:290
virtual ~qep_row()=default
column< double > col_cond_cost
Cost of evaluating conditions on this table per query.
Definition: opt_explain_format.h:316
List< Window > * m_windows
Windows to describe in this node.
Definition: opt_explain_format.h:349
qep_row(const qep_row &x)
bool is_materialized_from_subquery
Definition: opt_explain_format.h:341
mem_root_str col_data_size_query
Size of data expected to be read per query.
Definition: opt_explain_format.h:319
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
enum_explain_type
Query_block type enum.
Definition: sql_lex.h:1131
void * memdup_root(MEM_ROOT *root, const void *str, size_t len)
Definition: my_alloc.cc:295
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:131
enum_parsing_context
Names for different query parse tree parts.
Definition: parse_tree_node_base.h:58
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:124
enum_parsing_context type
type tag
Definition: opt_explain_format.h:125
Explain_context(enum_parsing_context type_arg)
Definition: opt_explain_format.h:127
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
A wrapper for numeric table properties.
Definition: opt_explain_format.h:166
column()
Definition: opt_explain_format.h:173
bool nil
true if the column contains NULL
Definition: opt_explain_format.h:168
T get() const
Definition: opt_explain_format.h:180
void set(T value_arg)
Definition: opt_explain_format.h:176
T value
Definition: opt_explain_format.h:170
bool is_empty() const
Definition: opt_explain_format.h:174
void cleanup()
Definition: opt_explain_format.h:175
Helper class to keep string data in MEM_ROOT before passing to Item_string.
Definition: opt_explain_format.h:198
size_t length
Definition: opt_explain_format.h:200
void cleanup()
Definition: opt_explain_format.h:205
void set_const(const char *str_arg, size_t length_arg)
Definition: opt_explain_format.h:242
bool set(const char *str_arg)
Definition: opt_explain_format.h:211
void set_const(const char *str_arg)
Make a copy of string constant.
Definition: opt_explain_format.h:239
void set(Lazy *x)
Save expression for further evaluation.
Definition: opt_explain_format.h:228
static char * strndup_root(MEM_ROOT *root, const char *str, size_t len)
Definition: opt_explain_format.h:248
Lazy * deferred
encapsulated expression to evaluate it later (on demand)
Definition: opt_explain_format.h:202
bool is_empty()
Definition: opt_explain_format.cc:32
mem_root_str()
Definition: opt_explain_format.h:204
const char * str
Definition: opt_explain_format.h:199
bool set(const String &s)
Definition: opt_explain_format.h:212
unsigned int uint
Definition: uca9-dump.cc:75