diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2021-02-25 08:04:35 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2021-02-25 08:10:03 +0530 |
commit | f7c82a5bbc71a586bb65c8563d0f90e8c94a1481 (patch) | |
tree | e2b172bef85b8c0067cd6a07e793f4624b8995a6 /sql/sql_select.h | |
parent | d542c8d61f47ee46a09fd10a046f262ff6a08336 (diff) | |
download | mariadb-git-10.6-limit.tar.gz |
Attempt to have sort-nest as a bush10.6-order_by_limit10.6-limit
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r-- | sql/sql_select.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h index 825016e8d4a..e4e3ce71037 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -192,6 +192,8 @@ enum join_type { JT_UNKNOWN,JT_SYSTEM,JT_CONST,JT_EQ_REF,JT_REF,JT_MAYBE_REF, JT_UNIQUE_SUBQUERY, JT_INDEX_SUBQUERY, JT_INDEX_MERGE, JT_HASH, JT_HASH_RANGE, JT_HASH_NEXT, JT_HASH_INDEX_MERGE}; +enum nest_type {NONE, SJM_NEST, SORT_NEST}; + class JOIN; enum enum_nested_loop_state @@ -283,7 +285,7 @@ typedef struct st_join_table { st_join_table *first_unmatched; /**< used for optimization purposes only */ /* - For join tabs that are inside an SJM bush: root of the bush + For join tabs that are inside a nest bush: root of the bush */ st_join_table *bush_root_tab; @@ -296,6 +298,8 @@ typedef struct st_join_table { NULL - this join tab has no bush children */ JOIN_TAB_RANGE *bush_children; + + nest_type mat_nest_type; /* Special content for EXPLAIN 'Extra' column or NULL if none */ enum explain_extra_tag info; @@ -650,7 +654,14 @@ typedef struct st_join_table { bool pfs_batch_update(JOIN *join); - bool is_sjm_nest() { return MY_TEST(bush_children); } + bool is_sjm_nest() const + { + return MY_TEST(bush_children && mat_nest_type == SJM_NEST); + } + bool is_sorted_nest() const + { + return MY_TEST(bush_children && mat_nest_type == SORT_NEST); + } /* If this join_tab reads a non-merged semi-join (also called jtbm), return @@ -2011,6 +2022,10 @@ public: void make_notnull_conds_for_range_scans(); bool transform_in_predicates_into_in_subq(THD *thd); + bool fill_join_tab_structures(uint *tablenr, JOIN_TAB *j, + JOIN_TAB *sjm_nest_root, + JOIN_TAB *sjm_nest_end, bool inner_sjm_table); + JOIN_TAB_RANGE* allocate_bush(uint tables); private: /** Create a temporary table to be used for processing DISTINCT/ORDER |