23#ifndef OPT_EXPLAIN_FORMAT_INCLUDED
24#define OPT_EXPLAIN_FORMAT_INCLUDED
166 template <
typename T>
212 bool set(
const char *str_arg) {
return set(str_arg, strlen(str_arg)); }
222 bool set(
const char *str_arg,
size_t length_arg);
241 return set_const(str_arg, strlen(str_arg));
243 void set_const(
const char *str_arg,
size_t length_arg) {
250 if (len == 0 ||
str ==
nullptr)
return const_cast<char *
>(
"");
251 if (
str[len - 1] == 0)
254 char *ret =
static_cast<char *
>(root->
Alloc(len + 1));
255 if (ret !=
nullptr) {
256 memcpy(ret,
str, len);
280 :
tag(tag_arg),
data(data_arg) {}
474 sorts[clause] &= ~property;
481 return sorts[clause] & property;
495 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:374
Emulate lazy computation.
Definition: opt_explain_format.h:104
virtual bool eval(String *ret)=0
Deferred evaluation of encapsulated expression.
Definition: sql_list.h:433
A JSON object (unordered set of key/value pairs).
Definition: opt_trace.h:798
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:57
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:166
const char * ptr() const
Definition: sql_string.h:248
size_t length() const
Definition: sql_string.h:240
Represents the (explicit) window of a SQL 2003 section 7.11 <window clause>, or the implicit (inlined...
Definition: window.h:104
Base class for all intermediate tree nodes.
Definition: opt_explain_json.cc:219
Helper class for table property buffering.
Definition: opt_explain_format.h:149
List< const char > col_partial_update_columns
List of columns that can be updated using partial update.
Definition: opt_explain_format.h:326
List< const char > col_partitions
"partitions" column
Definition: opt_explain_format.h:292
void format_extra(Opt_trace_object *obj)
Definition: opt_explain_json.cc:2091
mem_root_str col_message
replaces "Extra" column if not empty
Definition: opt_explain_format.h:305
List< extra > col_extra
"extra" column (traditional) or property list
Definition: opt_explain_format.h:302
void cleanup()
Definition: opt_explain_format.h:364
qep_row & operator=(const qep_row &x)
List< const char > col_possible_keys
"possible_keys": comma-separated list
Definition: opt_explain_format.h:295
mem_root_str col_attached_condition
former "Using where"
Definition: opt_explain_format.h:306
enum_mod_type mod_type
Definition: opt_explain_format.h:341
mem_root_str col_join_type
"type" column, see join_type_str array
Definition: opt_explain_format.h:293
mem_root_str col_key_len
"key_length" column: length of the "key" above
Definition: opt_explain_format.h:298
column< double > col_prefix_cost
Cost of the partial join including this table.
Definition: opt_explain_format.h:315
column< ulonglong > col_rows
"rows": estimated number of examined table rows per single scan
Definition: opt_explain_format.h:309
column< double > col_read_cost
Time to read the table.
Definition: opt_explain_format.h:313
column< float > col_filtered
"filtered": % of rows filtered by condition
Definition: opt_explain_format.h:301
List< const char > col_key_parts
used parts of the key
Definition: opt_explain_format.h:336
List< const char > col_used_columns
List of used columns.
Definition: opt_explain_format.h:323
column< uint > col_id
"id" column: seq. number of SELECT within the query
Definition: opt_explain_format.h:289
List< const char > col_ref
"ref":columns/constants which are compared to "key"
Definition: opt_explain_format.h:300
qep_row()
Definition: opt_explain_format.h:352
column< ulonglong > col_prefix_rows
"rows": estimated number of examined table rows per query
Definition: opt_explain_format.h:311
mem_root_str col_key
"key" column: index that is actually decided to use
Definition: opt_explain_format.h:297
bool using_temporary
Definition: opt_explain_format.h:340
virtual void register_where_subquery(Query_expression *subquery)
Remember a subquery's unit.
Definition: opt_explain_format.h:416
bool is_dependent
Definition: opt_explain_format.h:338
List< opt_explain_json_namespace::context > derived_from
List of "derived" subquery trees.
Definition: opt_explain_format.h:334
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:348
uint query_block_id
query block id for materialized subqueries
Definition: opt_explain_format.h:329
column< enum_explain_type > col_select_type
"select_type" column
Definition: opt_explain_format.h:290
bool is_cacheable
Definition: opt_explain_format.h:339
mem_root_str col_table_name
"table" to which the row of output refers
Definition: opt_explain_format.h:291
virtual ~qep_row()=default
column< double > col_cond_cost
Cost of evaluating conditions on this table per query.
Definition: opt_explain_format.h:317
List< Window > * m_windows
Windows to describe in this node.
Definition: opt_explain_format.h:350
qep_row(const qep_row &x)
bool is_materialized_from_subquery
Definition: opt_explain_format.h:342
mem_root_str col_data_size_query
Size of data expected to be read per query.
Definition: opt_explain_format.h:320
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
enum_explain_type
Query_block type enum.
Definition: sql_lex.h:1137
void * memdup_root(MEM_ROOT *root, const void *str, size_t len)
Definition: my_alloc.cc:294
static int flags[50]
Definition: hp_test1.cc:39
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:62
Common header for many mysys elements.
Definition: opt_explain_format.h:132
enum_parsing_context
Names for different query parse tree parts.
Definition: parse_tree_node_base.h:60
struct result result
Definition: result.h:33
Our own string classes, used pervasively throughout the executor.
Base class for all EXPLAIN context descriptor classes.
Definition: opt_explain_format.h:125
enum_parsing_context type
type tag
Definition: opt_explain_format.h:126
Explain_context(enum_parsing_context type_arg)
Definition: opt_explain_format.h:128
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82
void * Alloc(size_t length)
Allocate memory.
Definition: my_alloc.h:144
A wrapper for numeric table properties.
Definition: opt_explain_format.h:167
column()
Definition: opt_explain_format.h:174
bool nil
true if the column contains NULL
Definition: opt_explain_format.h:169
T get() const
Definition: opt_explain_format.h:181
void set(T value_arg)
Definition: opt_explain_format.h:177
T value
Definition: opt_explain_format.h:171
bool is_empty() const
Definition: opt_explain_format.h:175
void cleanup()
Definition: opt_explain_format.h:176
Helper class to keep string data in MEM_ROOT before passing to Item_string.
Definition: opt_explain_format.h:199
size_t length
Definition: opt_explain_format.h:201
void cleanup()
Definition: opt_explain_format.h:206
void set_const(const char *str_arg, size_t length_arg)
Definition: opt_explain_format.h:243
bool set(const char *str_arg)
Definition: opt_explain_format.h:212
void set_const(const char *str_arg)
Make a copy of string constant.
Definition: opt_explain_format.h:240
void set(Lazy *x)
Save expression for further evaluation.
Definition: opt_explain_format.h:229
static char * strndup_root(MEM_ROOT *root, const char *str, size_t len)
Definition: opt_explain_format.h:249
Lazy * deferred
encapsulated expression to evaluate it later (on demand)
Definition: opt_explain_format.h:203
bool is_empty()
Definition: opt_explain_format.cc:31
mem_root_str()
Definition: opt_explain_format.h:205
const char * str
Definition: opt_explain_format.h:200
bool set(const String &s)
Definition: opt_explain_format.h:213