29#ifndef SQL_OPT_EXEC_SHARED_INCLUDED
30#define SQL_OPT_EXEC_SHARED_INCLUDED
55#define NO_PLAN_IDX (-2)
56#define PRE_FIRST_PLAN_IDX \
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Definition: sql_bitmap.h:154
Sorting related info.
Definition: filesort.h:52
Definition: item_func.h:3539
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:930
Definition: sql_optimizer.h:133
Owner of a QEP_shared; parent of JOIN_TAB and QEP_TAB.
Definition: sql_opt_exec_shared.h:478
void set_first_inner(plan_idx i)
Definition: sql_opt_exec_shared.h:516
void set_position(POSITION *p)
Definition: sql_opt_exec_shared.h:506
void set_prefix_tables(table_map prefix_tables, table_map prev_tables)
Definition: sql_opt_exec_shared.h:543
JOIN * join() const
Definition: sql_opt_exec_shared.h:491
void set_type(enum join_type t)
Definition: sql_opt_exec_shared.h:525
TABLE * table() const
Definition: sql_opt_exec_shared.h:504
Key_map & keys() const
Definition: sql_opt_exec_shared.h:534
QEP_shared * m_qs
Definition: sql_opt_exec_shared.h:574
bool is_single_inner_for_outer_join() const
Definition: sql_opt_exec_shared.h:558
plan_idx first_upper() const
Definition: sql_opt_exec_shared.h:515
void set_condition(Item *to)
Definition: sql_opt_exec_shared.h:527
qep_tab_map idx_map() const
Definition: sql_opt_exec_shared.h:499
plan_idx first_sj_inner() const
Definition: sql_opt_exec_shared.h:511
bool is_first_inner_for_outer_join() const
Definition: sql_opt_exec_shared.h:555
AccessPath * range_scan() const
Definition: sql_opt_exec_shared.h:537
bool is_single_inner_of_semi_join() const
Definition: sql_opt_exec_shared.h:549
void set_skip_records_in_range(bool skip_records_in_range)
Definition: sql_opt_exec_shared.h:565
void set_first_sj_inner(plan_idx i)
Definition: sql_opt_exec_shared.h:518
Semijoin_mat_exec * sj_mat_exec() const
Definition: sql_opt_exec_shared.h:507
uint index() const
Definition: sql_opt_exec_shared.h:522
void set_qs(QEP_shared *q)
Definition: sql_opt_exec_shared.h:484
plan_idx first_inner() const
Definition: sql_opt_exec_shared.h:513
bool is_inner_table_of_outer_join() const
Definition: sql_opt_exec_shared.h:552
void set_last_inner(plan_idx i)
Definition: sql_opt_exec_shared.h:517
void set_range_scan(AccessPath *q)
Definition: sql_opt_exec_shared.h:538
void set_ft_func(Item_func_match *f)
Definition: sql_opt_exec_shared.h:542
void set_first_upper(plan_idx i)
Definition: sql_opt_exec_shared.h:520
void set_records(ha_rows r)
Definition: sql_opt_exec_shared.h:536
ha_rows records() const
Definition: sql_opt_exec_shared.h:535
table_map prefix_tables() const
Definition: sql_opt_exec_shared.h:539
bool has_guarded_conds() const
Definition: sql_opt_exec_shared.h:562
QEP_shared_owner()
Definition: sql_opt_exec_shared.h:480
void set_join(JOIN *j)
Definition: sql_opt_exec_shared.h:492
bool skip_records_in_range() const
Definition: sql_opt_exec_shared.h:569
bool condition_is_pushed_to_sort() const
Definition: sql_opt_exec_shared.h:528
void mark_condition_as_pushed_to_sort()
Definition: sql_opt_exec_shared.h:531
Item * condition() const
Definition: sql_opt_exec_shared.h:526
enum join_type type() const
Definition: sql_opt_exec_shared.h:524
void share_qs(QEP_shared_owner *other)
Instructs to share the QEP_shared with another owner.
Definition: sql_opt_exec_shared.h:483
plan_idx last_inner() const
Definition: sql_opt_exec_shared.h:514
plan_idx idx() const
Definition: sql_opt_exec_shared.h:497
void add_prefix_tables(table_map tables)
Definition: sql_opt_exec_shared.h:546
void set_idx(plan_idx i)
Definition: sql_opt_exec_shared.h:498
POSITION * position() const
Definition: sql_opt_exec_shared.h:505
Index_lookup & ref() const
Definition: sql_opt_exec_shared.h:521
void set_index(uint i)
Definition: sql_opt_exec_shared.h:523
void set_sj_mat_exec(Semijoin_mat_exec *s)
Definition: sql_opt_exec_shared.h:508
Item_func_match * ft_func() const
Definition: sql_opt_exec_shared.h:541
table_map added_tables() const
Definition: sql_opt_exec_shared.h:540
plan_idx last_sj_inner() const
Definition: sql_opt_exec_shared.h:512
void set_last_sj_inner(plan_idx i)
Definition: sql_opt_exec_shared.h:519
Holds members common to JOIN_TAB and QEP_TAB.
Definition: sql_opt_exec_shared.h:236
bool m_skip_records_in_range
Set if index dive can be skipped for this query.
Definition: sql_opt_exec_shared.h:474
table_map added_tables() const
Definition: sql_opt_exec_shared.h:311
void set_join(JOIN *j)
Definition: sql_opt_exec_shared.h:267
plan_idx m_first_sj_inner
Boundaries of semijoin inner tables around this table.
Definition: sql_opt_exec_shared.h:392
QEP_shared()
Definition: sql_opt_exec_shared.h:238
JOIN * m_join
Definition: sql_opt_exec_shared.h:359
bool is_first_inner_for_outer_join() const
Definition: sql_opt_exec_shared.h:340
Item_func_match * m_ft_func
FT function.
Definition: sql_opt_exec_shared.h:468
bool is_single_inner_of_outer_join() const
Definition: sql_opt_exec_shared.h:348
Semijoin_mat_exec * sj_mat_exec() const
Definition: sql_opt_exec_shared.h:280
plan_idx m_idx
Index of structure in array:
Definition: sql_opt_exec_shared.h:367
void set_last_sj_inner(plan_idx i)
Definition: sql_opt_exec_shared.h:288
void set_first_sj_inner(plan_idx i)
Definition: sql_opt_exec_shared.h:287
AccessPath * m_range_scan
Non-NULL if quick-select used.
Definition: sql_opt_exec_shared.h:449
plan_idx m_last_inner
last table table for embedding outer join
Definition: sql_opt_exec_shared.h:398
plan_idx first_inner()
Definition: sql_opt_exec_shared.h:284
bool is_single_inner_of_semi_join() const
Definition: sql_opt_exec_shared.h:345
void set_position(POSITION *p)
Definition: sql_opt_exec_shared.h:279
POSITION * position() const
Definition: sql_opt_exec_shared.h:278
Index_lookup & ref()
Definition: sql_opt_exec_shared.h:292
void add_prefix_tables(table_map tables)
Add an available set of tables for a table in a join plan.
Definition: sql_opt_exec_shared.h:335
bool is_inner_table_of_outer_join() const
Definition: sql_opt_exec_shared.h:342
bool condition_is_pushed_to_sort() const
Definition: sql_opt_exec_shared.h:299
plan_idx first_sj_inner()
Definition: sql_opt_exec_shared.h:282
void set_range_scan(AccessPath *q)
Definition: sql_opt_exec_shared.h:309
void set_ft_func(Item_func_match *f)
Definition: sql_opt_exec_shared.h:313
Semijoin_mat_exec * m_sj_mat_exec
Struct needed for materialization of semi-join.
Definition: sql_opt_exec_shared.h:384
AccessPath * range_scan() const
Definition: sql_opt_exec_shared.h:308
plan_idx m_first_upper
first inner table for embedding outer join
Definition: sql_opt_exec_shared.h:399
table_map prefix_tables_map
The set of all tables available in the join prefix for this table, including the table handled by thi...
Definition: sql_opt_exec_shared.h:460
bool m_condition_is_pushed_to_sort
Whether the condition in m_condition is evaluated in front of a sort, so that it does not need to be ...
Definition: sql_opt_exec_shared.h:429
plan_idx m_last_sj_inner
Definition: sql_opt_exec_shared.h:392
TABLE * table() const
Definition: sql_opt_exec_shared.h:276
Item * m_condition
Table condition, ie condition to be evaluated for a row from this table.
Definition: sql_opt_exec_shared.h:419
void set_first_inner(plan_idx i)
Definition: sql_opt_exec_shared.h:285
Index_lookup m_ref
Used to do index-based look up based on a key value.
Definition: sql_opt_exec_shared.h:406
void set_index(uint i)
Definition: sql_opt_exec_shared.h:294
Key_map m_keys
All keys with can be used.
Definition: sql_opt_exec_shared.h:436
uint index() const
Definition: sql_opt_exec_shared.h:293
ha_rows records() const
Definition: sql_opt_exec_shared.h:306
TABLE * m_table
Corresponding table. Might be an internal temporary one.
Definition: sql_opt_exec_shared.h:370
void set_type(enum join_type t)
Definition: sql_opt_exec_shared.h:296
uint m_index
ID of index used for index scan or semijoin LooseScan.
Definition: sql_opt_exec_shared.h:409
void mark_condition_as_pushed_to_sort()
Definition: sql_opt_exec_shared.h:302
ha_rows m_records
Either number of rows in the table or 1 for const table.
Definition: sql_opt_exec_shared.h:442
POSITION * m_position
Points into best_positions array. Includes cost info.
Definition: sql_opt_exec_shared.h:373
enum join_type type() const
Definition: sql_opt_exec_shared.h:295
void set_condition(Item *c)
Definition: sql_opt_exec_shared.h:298
plan_idx m_first_inner
first inner table for including outer join
Definition: sql_opt_exec_shared.h:397
void set_prefix_tables(table_map prefix_tables_arg, table_map prev_tables_arg)
Set available tables for a table in a join plan.
Definition: sql_opt_exec_shared.h:324
table_map added_tables_map
The set of tables added for this table, compared to the previous table in the join prefix.
Definition: sql_opt_exec_shared.h:465
table_map prefix_tables() const
Definition: sql_opt_exec_shared.h:310
Key_map & keys()
Definition: sql_opt_exec_shared.h:305
enum join_type m_type
Type of chosen access method (scan, etc).
Definition: sql_opt_exec_shared.h:412
Item * condition() const
Definition: sql_opt_exec_shared.h:297
plan_idx idx() const
Definition: sql_opt_exec_shared.h:268
void set_records(ha_rows r)
Definition: sql_opt_exec_shared.h:307
plan_idx last_inner()
Definition: sql_opt_exec_shared.h:290
void set_first_upper(plan_idx i)
Definition: sql_opt_exec_shared.h:289
plan_idx last_sj_inner()
Definition: sql_opt_exec_shared.h:283
void set_idx(plan_idx i)
Definition: sql_opt_exec_shared.h:272
Item_func_match * ft_func() const
Definition: sql_opt_exec_shared.h:312
bool skip_records_in_range() const
Definition: sql_opt_exec_shared.h:356
JOIN * join() const
Definition: sql_opt_exec_shared.h:266
void set_table(TABLE *t)
Definition: sql_opt_exec_shared.h:277
plan_idx first_upper()
Definition: sql_opt_exec_shared.h:291
void set_sj_mat_exec(Semijoin_mat_exec *s)
Definition: sql_opt_exec_shared.h:281
void set_skip_records_in_range(bool skip_records_in_range)
Definition: sql_opt_exec_shared.h:352
void set_last_inner(plan_idx i)
Definition: sql_opt_exec_shared.h:286
Executor structure for the materialized semi-join info, which contains.
Definition: sql_executor.h:135
class to copying an field/item to a key struct
Definition: sql_select.h:813
const char * p
Definition: ctype-mb.cc:1225
bool and_with_condition(Item *tmp_cond)
Extend join_tab->cond by AND'ing add_cond to it.
Definition: sql_select.cc:3672
void qs_cleanup()
Definition: sql_select.cc:3633
This file includes constants used by all storage engines.
ulong key_part_map
Definition: my_base.h:1008
my_off_t ha_rows
Definition: my_base.h:1141
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52
uint64_t table_map
Definition: my_table_map.h:30
uint64_t qep_tab_map
Definition: my_table_map.h:32
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:86
join_type
Definition: sql_opt_exec_shared.h:186
@ JT_RANGE
Definition: sql_opt_exec_shared.h:214
@ JT_EQ_REF
Definition: sql_opt_exec_shared.h:202
@ JT_INDEX_SCAN
Definition: sql_opt_exec_shared.h:219
@ JT_FT
Definition: sql_opt_exec_shared.h:221
@ JT_SYSTEM
Definition: sql_opt_exec_shared.h:190
@ JT_REF_OR_NULL
Definition: sql_opt_exec_shared.h:226
@ JT_REF
Definition: sql_opt_exec_shared.h:206
@ JT_CONST
Definition: sql_opt_exec_shared.h:196
@ JT_INDEX_MERGE
Definition: sql_opt_exec_shared.h:232
@ JT_UNKNOWN
Definition: sql_opt_exec_shared.h:188
@ JT_ALL
Definition: sql_opt_exec_shared.h:210
int plan_idx
This represents the index of a JOIN_TAB/QEP_TAB in an array.
Definition: sql_opt_exec_shared.h:54
#define NO_PLAN_IDX
undefined index
Definition: sql_opt_exec_shared.h:55
@ REF_SLICE_WIN_1
The slice with pointers to columns of 1st tmp table of windowing.
Definition: sql_opt_exec_shared.h:642
@ REF_SLICE_ACTIVE
The slice which is used during evaluation of expressions; Item_ref::ref points there.
Definition: sql_opt_exec_shared.h:621
@ REF_SLICE_TMP2
The slice with pointers to columns of 2nd group-order-distinct tmp table.
Definition: sql_opt_exec_shared.h:631
@ REF_SLICE_SAVED_BASE
The slice with pointers to columns of table(s), ie., the actual Items.
Definition: sql_opt_exec_shared.h:638
@ REF_SLICE_TMP1
The slice with pointers to columns of 1st group-order-distinct tmp table.
Definition: sql_opt_exec_shared.h:626
Access paths are a query planning structure that correspond 1:1 to iterators, in that an access path ...
Definition: access_path.h:227
Structure used for index-based lookups.
Definition: sql_opt_exec_shared.h:67
uchar * key_buff
value to look for with key
Definition: sql_opt_exec_shared.h:72
ulonglong * keypart_hash
Definition: sql_opt_exec_shared.h:128
table_map depend_map
Table depends on these tables.
Definition: sql_opt_exec_shared.h:104
Item ** items
val()'s for each keypart
Definition: sql_opt_exec_shared.h:80
Index_lookup()
Definition: sql_opt_exec_shared.h:130
uint key_parts
num of ...
Definition: sql_opt_exec_shared.h:69
uint key_length
length of key_buff
Definition: sql_opt_exec_shared.h:70
bool impossible_null_ref() const
Definition: sql_opt_exec_shared.h:150
uchar * key_buff2
key_buff+key_length
Definition: sql_opt_exec_shared.h:73
bool key_err
Definition: sql_opt_exec_shared.h:68
bool ** cond_guards
Definition: sql_opt_exec_shared.h:97
ha_rows use_count
Definition: sql_opt_exec_shared.h:115
key_part_map null_rejecting
Definition: sql_opt_exec_shared.h:103
bool has_guarded_conds() const
Check if there are triggered/guarded conditions that might be 'switched off' by the subquery code whe...
Definition: sql_opt_exec_shared.h:168
int key
key no
Definition: sql_opt_exec_shared.h:71
bool disable_cache
Definition: sql_opt_exec_shared.h:121
store_key ** key_copy
Used to store the value from each keypart field.
Definition: sql_opt_exec_shared.h:79
uchar * null_ref_key
Definition: sql_opt_exec_shared.h:110
A position of table within a join order.
Definition: sql_select.h:355
synode_no q[FIFO_SIZE]
Definition: xcom_base.cc:4086