explain获得使用的key的数据
bool Explain_join::explain_key_and_len() { if (tab->ref.key_parts) return explain_key_and_len_index(tab->ref.key, tab->ref.key_length, tab->ref.key_parts); else if (tab->type == JT_INDEX_SCAN) return explain_key_and_len_index(tab->index); else if (select && select->quick) return explain_key_and_len_quick(select); else { const TABLE_LIST *table_list= table->pos_in_table_list; if (table_list->schema_table && table_list->schema_table->i_s_requested_object & OPTIMIZE_I_S_TABLE) { StringBuffer<512> str_key(cs); const char *f_name; int f_idx; if (table_list->has_db_lookup_value) { f_idx= table_list->schema_table->idx_field1; f_name= table_list->schema_table->fields_info[f_idx].field_name; str_key.append(f_name, strlen(f_name), cs); } if (table_list->has_table_lookup_value) { if (table_list->has_db_lookup_value) str_key.append(','); f_idx= table_list->schema_table->idx_field2; f_name= table_list->schema_table->fields_info[f_idx].field_name; str_key.append(f_name, strlen(f_name), cs); } if (str_key.length()) return fmt->entry()->col_key.set(str_key); } } return false; }
MySQL限时解答,24小时内友哥专业解答
http://www.yougemysqldba.com
如有进一步需要请联系微信onesoft007
微博账号@友哥一指
http://www.yougemysqldba.com
如有进一步需要请联系微信onesoft007
微博账号@友哥一指