mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-26301 Split optimization refills temporary table too many times
This patch optimizes the number of refills for the lateral derived table to which a materialized derived table subject to split optimization is is converted. This optimized number of refills is now considered as the expected number of refills of the materialized derived table when searching for the best possible splitting of the table.
This commit is contained in:
committed by
Oleksandr Byelkin
parent
ec79f37718
commit
ce7ffe61d8
@ -394,6 +394,8 @@ typedef struct st_join_table {
|
||||
*/
|
||||
bool idx_cond_fact_out;
|
||||
bool use_join_cache;
|
||||
/* TRUE <=> it is prohibited to join this table using join buffer */
|
||||
bool no_forced_join_cache;
|
||||
uint used_join_cache_level;
|
||||
ulong join_buffer_size_limit;
|
||||
JOIN_CACHE *cache;
|
||||
@ -520,6 +522,16 @@ typedef struct st_join_table {
|
||||
|
||||
bool preread_init_done;
|
||||
|
||||
/* true <=> split optimization has been applied to this materialized table */
|
||||
bool is_split_derived;
|
||||
|
||||
/*
|
||||
Bitmap of split materialized derived tables that can be filled just before
|
||||
this join table is to be joined. All parameters of the split derived tables
|
||||
belong to tables preceding this join table.
|
||||
*/
|
||||
table_map split_derived_to_update;
|
||||
|
||||
/*
|
||||
Cost info to the range filter used when joining this join table
|
||||
(Defined when the best join order has been already chosen)
|
||||
@ -680,9 +692,10 @@ typedef struct st_join_table {
|
||||
|
||||
void partial_cleanup();
|
||||
void add_keyuses_for_splitting();
|
||||
SplM_plan_info *choose_best_splitting(double record_count,
|
||||
table_map remaining_tables);
|
||||
bool fix_splitting(SplM_plan_info *spl_plan, table_map remaining_tables,
|
||||
SplM_plan_info *choose_best_splitting(uint idx,
|
||||
table_map remaining_tables,
|
||||
table_map *spl_pd_boundary);
|
||||
bool fix_splitting(SplM_plan_info *spl_plan, table_map excluded_tables,
|
||||
bool is_const_table);
|
||||
} JOIN_TAB;
|
||||
|
||||
@ -947,9 +960,21 @@ public:
|
||||
*/
|
||||
KEYUSE *key;
|
||||
|
||||
/* Cardinality of current partial join ending with this position */
|
||||
double partial_join_cardinality;
|
||||
|
||||
/* Info on splitting plan used at this position */
|
||||
SplM_plan_info *spl_plan;
|
||||
|
||||
/*
|
||||
If spl_plan is NULL the value of spl_pd_boundary is 0. Otherwise
|
||||
spl_pd_boundary contains the bitmap of the table from the current
|
||||
partial join ending at this position that starts the sub-sequence of
|
||||
tables S from which no conditions are allowed to be used in the plan
|
||||
spl_plan for the split table joined at this position.
|
||||
*/
|
||||
table_map spl_pd_boundary;
|
||||
|
||||
/* Cost info for the range filter used at this position */
|
||||
Range_rowid_filter_cost_info *range_rowid_filter_info;
|
||||
|
||||
|
Reference in New Issue
Block a user