mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.2 into 10.3
This commit is contained in:
@@ -452,11 +452,6 @@ bool find_eq_ref_candidate(TABLE *table, table_map sj_inner_tables);
|
||||
static SJ_MATERIALIZATION_INFO *
|
||||
at_sjmat_pos(const JOIN *join, table_map remaining_tables, const JOIN_TAB *tab,
|
||||
uint idx, bool *loose_scan);
|
||||
void best_access_path(JOIN *join, JOIN_TAB *s,
|
||||
table_map remaining_tables, uint idx,
|
||||
bool disable_jbuf, double record_count,
|
||||
POSITION *pos, POSITION *loose_scan_pos);
|
||||
|
||||
static Item *create_subq_in_equalities(THD *thd, SJ_MATERIALIZATION_INFO *sjm,
|
||||
Item_in_subselect *subq_pred);
|
||||
static bool remove_sj_conds(THD *thd, Item **tree);
|
||||
@@ -2718,6 +2713,13 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx,
|
||||
NULL,
|
||||
};
|
||||
|
||||
#ifdef HAVE_valgrind
|
||||
new (&pos->firstmatch_picker) Firstmatch_picker;
|
||||
new (&pos->loosescan_picker) LooseScan_picker;
|
||||
new (&pos->sjmat_picker) Sj_materialization_picker;
|
||||
new (&pos->dups_weedout_picker) Duplicate_weedout_picker;
|
||||
#endif
|
||||
|
||||
if (join->emb_sjm_nest)
|
||||
{
|
||||
/*
|
||||
@@ -3007,7 +3009,8 @@ bool Sj_materialization_picker::check_qep(JOIN *join,
|
||||
bool disable_jbuf= (join->thd->variables.join_cache_level == 0);
|
||||
for (i= first_tab + mat_info->tables; i <= idx; i++)
|
||||
{
|
||||
best_access_path(join, join->positions[i].table, rem_tables, i,
|
||||
best_access_path(join, join->positions[i].table, rem_tables,
|
||||
join->positions, i,
|
||||
disable_jbuf, prefix_rec_count, &curpos, &dummy);
|
||||
prefix_rec_count= COST_MULT(prefix_rec_count, curpos.records_read);
|
||||
prefix_cost= COST_ADD(prefix_cost, curpos.read_time);
|
||||
@@ -3626,7 +3629,8 @@ void fix_semijoin_strategies_for_picked_join_order(JOIN *join)
|
||||
join->cur_sj_inner_tables= 0;
|
||||
for (i= first + sjm->tables; i <= tablenr; i++)
|
||||
{
|
||||
best_access_path(join, join->best_positions[i].table, rem_tables, i,
|
||||
best_access_path(join, join->best_positions[i].table, rem_tables,
|
||||
join->best_positions, i,
|
||||
FALSE, prefix_rec_count,
|
||||
join->best_positions + i, &dummy);
|
||||
prefix_rec_count *= join->best_positions[i].records_read;
|
||||
@@ -3658,8 +3662,9 @@ void fix_semijoin_strategies_for_picked_join_order(JOIN *join)
|
||||
{
|
||||
if (join->best_positions[idx].use_join_buffer)
|
||||
{
|
||||
best_access_path(join, join->best_positions[idx].table,
|
||||
rem_tables, idx, TRUE /* no jbuf */,
|
||||
best_access_path(join, join->best_positions[idx].table,
|
||||
rem_tables, join->best_positions, idx,
|
||||
TRUE /* no jbuf */,
|
||||
record_count, join->best_positions + idx, &dummy);
|
||||
}
|
||||
record_count *= join->best_positions[idx].records_read;
|
||||
@@ -3689,7 +3694,8 @@ void fix_semijoin_strategies_for_picked_join_order(JOIN *join)
|
||||
if (join->best_positions[idx].use_join_buffer || (idx == first))
|
||||
{
|
||||
best_access_path(join, join->best_positions[idx].table,
|
||||
rem_tables, idx, TRUE /* no jbuf */,
|
||||
rem_tables, join->best_positions, idx,
|
||||
TRUE /* no jbuf */,
|
||||
record_count, join->best_positions + idx,
|
||||
&loose_scan_pos);
|
||||
if (idx==first)
|
||||
|
Reference in New Issue
Block a user