6780
if (table_list->schema_table &&
6781
table_list->schema_table->getRequestedObject() & OPTIMIZE_I_S_TABLE)
6783
if (table_list->has_db_lookup_value)
6785
int f_idx= table_list->schema_table->getFirstColumnIndex();
6786
const string &tmp_buff= table_list->schema_table->getColumnName(f_idx);
6787
tmp2.append(tmp_buff.c_str(), tmp_buff.length(), cs);
6789
if (table_list->has_table_lookup_value)
6791
if (table_list->has_db_lookup_value)
6793
int f_idx= table_list->schema_table->getSecondColumnIndex();
6794
const string &tmp_buff= table_list->schema_table->getColumnName(f_idx);
6795
tmp2.append(tmp_buff.c_str(), tmp_buff.length(), cs);
6798
item_list.push_back(new Item_string(tmp2.ptr(),tmp2.length(),cs));
6800
item_list.push_back(item_null);
6803
item_list.push_back(item_null);
6774
item_list.push_back(item_null);
6804
6775
item_list.push_back(item_null);
6805
6776
item_list.push_back(item_null);
6808
6779
/* Add "rows" field to item_list. */
6809
if (table_list->schema_table)
6780
double examined_rows;
6781
if (tab->select && tab->select->quick)
6782
examined_rows= rows2double(tab->select->quick->records);
6783
else if (tab->type == AM_NEXT || tab->type == AM_ALL)
6784
examined_rows= rows2double(tab->limit ? tab->limit :
6785
tab->table->cursor->records());
6812
if (join->session->lex->describe & DESCRIBE_EXTENDED)
6813
item_list.push_back(item_null);
6815
item_list.push_back(item_null);
6788
optimizer::Position cur_pos= join->getPosFromOptimalPlan(i);
6789
examined_rows= cur_pos.getFanout();
6792
item_list.push_back(new Item_int((int64_t) (uint64_t) examined_rows,
6793
MY_INT64_NUM_DECIMAL_DIGITS));
6795
/* Add "filtered" field to item_list. */
6796
if (join->session->lex->describe & DESCRIBE_EXTENDED)
6819
double examined_rows;
6820
if (tab->select && tab->select->quick)
6821
examined_rows= rows2double(tab->select->quick->records);
6822
else if (tab->type == AM_NEXT || tab->type == AM_ALL)
6823
examined_rows= rows2double(tab->limit ? tab->limit :
6824
tab->table->cursor->records());
6827
6801
optimizer::Position cur_pos= join->getPosFromOptimalPlan(i);
6828
examined_rows= cur_pos.getFanout();
6831
item_list.push_back(new Item_int((int64_t) (uint64_t) examined_rows,
6832
MY_INT64_NUM_DECIMAL_DIGITS));
6834
/* Add "filtered" field to item_list. */
6835
if (join->session->lex->describe & DESCRIBE_EXTENDED)
6840
optimizer::Position cur_pos= join->getPosFromOptimalPlan(i);
6841
f= (float) (100.0 * cur_pos.getFanout() /
6844
item_list.push_back(new Item_float(f, 2));
6802
f= (float) (100.0 * cur_pos.getFanout() /
6805
item_list.push_back(new Item_float(f, 2));
6848
6808
/* Build "Extra" field and add it to item_list. */
6931
6891
if (table->reginfo.not_exists_optimize)
6932
6892
extra.append(STRING_WITH_LEN("; Not exists"));
6934
if (table_list->schema_table &&
6935
table_list->schema_table->getRequestedObject() & OPTIMIZE_I_S_TABLE)
6937
if (!table_list->table_open_method)
6938
extra.append(STRING_WITH_LEN("; Skip_open_table"));
6939
else if (table_list->table_open_method == OPEN_FRM_ONLY)
6940
extra.append(STRING_WITH_LEN("; Open_frm_only"));
6942
extra.append(STRING_WITH_LEN("; Open_full_table"));
6943
if (table_list->has_db_lookup_value &&
6944
table_list->has_table_lookup_value)
6945
extra.append(STRING_WITH_LEN("; Scanned 0 databases"));
6946
else if (table_list->has_db_lookup_value ||
6947
table_list->has_table_lookup_value)
6948
extra.append(STRING_WITH_LEN("; Scanned 1 database"));
6950
extra.append(STRING_WITH_LEN("; Scanned all databases"));
6952
6894
if (need_tmp_table)
6954
6896
need_tmp_table=0;