|
|
|
@ -3928,7 +3928,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, |
|
|
|
int error= 0; |
|
|
|
TABLE *UNINIT_VAR(table); /* inited in all loops */ |
|
|
|
uint i,table_count,const_count,key; |
|
|
|
table_map found_const_table_map, all_table_map, found_ref, refs; |
|
|
|
table_map found_const_table_map, all_table_map; |
|
|
|
key_map const_ref, eq_part; |
|
|
|
bool has_expensive_keyparts; |
|
|
|
TABLE **table_vector; |
|
|
|
@ -4191,7 +4191,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, |
|
|
|
{ |
|
|
|
ref_changed = 0; |
|
|
|
more_const_tables_found: |
|
|
|
found_ref=0; |
|
|
|
|
|
|
|
/*
|
|
|
|
We only have to loop from stat_vector + const_count as |
|
|
|
@ -4280,7 +4279,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, |
|
|
|
key=keyuse->key; |
|
|
|
s->keys.set_bit(key); // TODO: remove this ?
|
|
|
|
|
|
|
|
refs=0; |
|
|
|
const_ref.clear_all(); |
|
|
|
eq_part.clear_all(); |
|
|
|
has_expensive_keyparts= false; |
|
|
|
@ -4296,8 +4294,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, |
|
|
|
if (keyuse->val->is_expensive()) |
|
|
|
has_expensive_keyparts= true; |
|
|
|
} |
|
|
|
else |
|
|
|
refs|=keyuse->used_tables; |
|
|
|
eq_part.set_bit(keyuse->keypart); |
|
|
|
} |
|
|
|
keyuse++; |
|
|
|
@ -4348,8 +4344,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, |
|
|
|
found_const_table_map|= table->map; |
|
|
|
break; |
|
|
|
} |
|
|
|
else |
|
|
|
found_ref|= refs; // Table is const if all refs are const
|
|
|
|
} |
|
|
|
else if (base_const_ref == base_eq_part) |
|
|
|
s->const_keys.set_bit(key); |
|
|
|
@ -26190,7 +26184,6 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab, |
|
|
|
*/ |
|
|
|
if (tab) |
|
|
|
{ |
|
|
|
key_part_map const_parts= 0; |
|
|
|
key_part_map map= 1; |
|
|
|
uint kp; |
|
|
|
/* Find how many key parts would be used by ref(const) */ |
|
|
|
@ -26198,7 +26191,6 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab, |
|
|
|
{ |
|
|
|
if (!(table->const_key_parts[keynr] & map)) |
|
|
|
break; |
|
|
|
const_parts |= map; |
|
|
|
} |
|
|
|
|
|
|
|
if (kp > 0) |
|
|
|
|