diff options
author | unknown <igor@rurik.mysql.com> | 2003-11-26 17:23:52 -0800 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2003-11-26 17:23:52 -0800 |
commit | da566c16c0c03f56caa8bd6bfd9452b73ad1a456 (patch) | |
tree | ccfdefe3940ac9e8bf4d61df4e3eb671b6a303a4 /sql/opt_sum.cc | |
parent | afe2186e3baea84d9eec0a898ef3e9be11c788af (diff) | |
download | mariadb-git-da566c16c0c03f56caa8bd6bfd9452b73ad1a456.tar.gz |
This ChangeSet Introdices Item_equal.
The objects of this class represent multiple conjunctive equalities
in where conditions: =(f1,f2,...fn) <=> f1=f2 and f2= ... and =fn.
The objects are used to generate new possibale paths to access
the tables when executing a query.
They are also used to optimize the execution plan
chosen by the optimizer for the query.
sql/item.cc:
Introduced Item_equal
sql/item.h:
Introduced Item_equal.
Added traverse method.
sql/item_cmpfunc.cc:
Introduced Item_equal.
Added traverse mehtod.
sql/item_cmpfunc.h:
Itroduced Item_equal and Item_equal_iterator.
sql/item_func.cc:
Added traverse method.
Introduced Item_equal.
sql/item_func.h:
Introduced Item_equal.
Added traverse method.
sql/item_row.cc:
Added traverse method.
sql/item_row.h:
Added traverse method.
sql/item_strfunc.h:
Added traverse method.
sql/opt_range.cc:
Used Item_equal in range analysis.
sql/opt_sum.cc:
Introduced Item_equal.
sql/sql_list.h:
Added concat and disjoin methods to lists.
Fixed remove method for lists.
sql/sql_select.cc:
Introdiced Item_equal:
created Item_equal;
used Item_equal objects to generate new paths to access tables.
used Item_equal objects to optimize the execution plan chosen by optimizer.
sql/sql_select.h:
Introduced Item_equal.
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r-- | sql/opt_sum.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 932aceebdbb..ce650701347 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -352,6 +352,18 @@ static bool simple_pred(Item_func *func_item, Item **args, bool *inv_order) Item *item; *inv_order= 0; switch (func_item->argument_count()) { + case 0: + /* MULT_EQUAL_FUNC */ + { + Item_equal *item_equal= (Item_equal *) func_item; + Item_equal_iterator it(*item_equal); + args[0]= it++; + if (it++) + return 0; + if (!(args[1]= item_equal->get_const())) + return 0; + } + break; case 1: /* field IS NULL */ item= func_item->arguments()[0]; @@ -492,6 +504,9 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo, case Item_func::BETWEEN: between= 1; break; + case Item_func::MULT_EQUAL_FUNC: + eq_type= 1; + break; default: return 0; // Can't optimize function } |