@@ -8942,7 +8942,7 @@ determine_search_depth(JOIN *join)
8942
8942
*/
8943
8943
8944
8944
static void
8945
- optimize_straight_join(JOIN *join, table_map join_tables )
8945
+ optimize_straight_join(JOIN *join, table_map remaining_tables )
8946
8946
{
8947
8947
JOIN_TAB *s;
8948
8948
uint idx= join->const_tables;
@@ -8960,30 +8960,32 @@ optimize_straight_join(JOIN *join, table_map join_tables)
8960
8960
Json_writer_object trace_one_table(thd);
8961
8961
if (unlikely(thd->trace_started()))
8962
8962
{
8963
- trace_plan_prefix(join, idx, join_tables );
8963
+ trace_plan_prefix(join, idx, remaining_tables );
8964
8964
trace_one_table.add_table_name(s);
8965
8965
}
8966
8966
/* Find the best access method from 's' to the current partial plan */
8967
- best_access_path(join, s, join_tables , join->positions, idx,
8967
+ best_access_path(join, s, remaining_tables , join->positions, idx,
8968
8968
disable_jbuf, record_count,
8969
8969
position, &loose_scan_pos);
8970
8970
8971
- /* compute the cost of the new plan extended with 's' */
8971
+ /* Compute the cost of the new plan extended with 's' */
8972
8972
record_count= COST_MULT(record_count, position->records_read);
8973
8973
const double filter_cmp_gain= position->range_rowid_filter_info
8974
8974
? position->range_rowid_filter_info->get_cmp_gain(record_count)
8975
8975
: 0;
8976
- read_time+= COST_ADD(read_time - filter_cmp_gain,
8977
- COST_ADD(position->read_time,
8978
- record_count / TIME_FOR_COMPARE));
8979
- advance_sj_state(join, join_tables, idx, &record_count, &read_time,
8976
+ read_time= COST_ADD(read_time,
8977
+ COST_ADD(position->read_time -
8978
+ filter_cmp_gain,
8979
+ record_count /
8980
+ TIME_FOR_COMPARE));
8981
+ advance_sj_state(join, remaining_tables, idx, &record_count, &read_time,
8980
8982
&loose_scan_pos);
8981
8983
8982
- join_tables &= ~(s->table->map);
8984
+ remaining_tables &= ~(s->table->map);
8983
8985
double pushdown_cond_selectivity= 1.0;
8984
8986
if (use_cond_selectivity > 1)
8985
8987
pushdown_cond_selectivity= table_cond_selectivity(join, idx, s,
8986
- join_tables );
8988
+ remaining_tables );
8987
8989
position->cond_selectivity= pushdown_cond_selectivity;
8988
8990
++idx;
8989
8991
}
@@ -9965,16 +9967,16 @@ best_extension_by_limited_search(JOIN *join,
9965
9967
best_access_path(join, s, remaining_tables, join->positions, idx,
9966
9968
disable_jbuf, record_count, position, &loose_scan_pos);
9967
9969
9968
- /* Compute the cost of extending the plan with 's' */
9970
+ /* Compute the cost of the new plan extended with 's' */
9969
9971
current_record_count= COST_MULT(record_count, position->records_read);
9970
9972
const double filter_cmp_gain= position->range_rowid_filter_info
9971
9973
? position->range_rowid_filter_info->get_cmp_gain(current_record_count)
9972
9974
: 0;
9973
- current_read_time=COST_ADD(read_time,
9974
- COST_ADD(position->read_time -
9975
- filter_cmp_gain,
9976
- current_record_count /
9977
- TIME_FOR_COMPARE));
9975
+ current_read_time= COST_ADD(read_time,
9976
+ COST_ADD(position->read_time -
9977
+ filter_cmp_gain,
9978
+ current_record_count /
9979
+ TIME_FOR_COMPARE));
9978
9980
9979
9981
if (unlikely(thd->trace_started()))
9980
9982
{
0 commit comments