1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00
This commit is contained in:
Igor Babaev
2011-05-20 12:47:39 -07:00
99 changed files with 4333 additions and 1174 deletions

View File

@ -336,6 +336,8 @@ typedef struct st_join_table {
struct st_join_table *first_sjm_sibling;
bool preread_init_done;
void cleanup();
inline bool is_using_loose_index_scan()
{
@ -441,6 +443,22 @@ typedef struct st_join_table {
{
return (is_hash_join_key_no(key) ? hj_key : table->key_info+key);
}
double scan_time()
{
double res;
if (table->created)
{
res= table->file->scan_time();
read_time=(ha_rows) res;
}
else
{
read_time= found_records ? found_records: 10;// TODO:fix this stub
res= (double)read_time;
}
return res;
}
bool preread_init();
} JOIN_TAB;
@ -892,6 +910,7 @@ public:
bool optimized; ///< flag to avoid double optimization in EXPLAIN
bool initialized; ///< flag to avoid double init_execution calls
Array<Item_in_subselect> sj_subselects;
/*
Additional WHERE and HAVING predicates to be considered for IN=>EXISTS
@ -1057,6 +1076,7 @@ public:
{
return (table_map(1) << tables) - 1;
}
void drop_unused_derived_keys();
/*
Return the table for which an index scan can be used to satisfy
the sort order needed by the ORDER BY/(implicit) GROUP BY clause
@ -1121,7 +1141,7 @@ Field* create_tmp_field_from_field(THD *thd, Field* org_field,
/* functions from opt_sum.cc */
bool simple_pred(Item_func *func_item, Item **args, bool *inv_order);
int opt_sum_query(THD* thd,
TABLE_LIST *tables, List<Item> &all_fields, COND *conds);
List<TABLE_LIST> &tables, List<Item> &all_fields, COND *conds);
/* from sql_delete.cc, used by opt_range.cc */
extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b);
@ -1383,7 +1403,7 @@ void push_index_cond(JOIN_TAB *tab, uint keyno);
TABLE *create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
ORDER *group, bool distinct, bool save_sum_fields,
ulonglong select_options, ha_rows rows_limit,
char* alias);
char* alias, bool do_not_open=FALSE);
void free_tmp_table(THD *thd, TABLE *entry);
bool create_internal_tmp_table_from_heap(THD *thd, TABLE *table,
ENGINE_COLUMNDEF *start_recinfo,
@ -1396,5 +1416,6 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
bool open_tmp_table(TABLE *table);
void setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps);
double prev_record_reads(POSITION *positions, uint idx, table_map found_ref);
void fix_list_after_tbl_changes(SELECT_LEX *new_parent, List<TABLE_LIST> *tlist);
#endif /* SQL_SELECT_INCLUDED */