diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2009-08-17 18:02:29 +0300 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2009-08-17 18:02:29 +0300 |
commit | 01291632015057de4e56aeeef33c426a11959e55 (patch) | |
tree | c3c3b29536f22b603366c827a0c890c3fffa713b /sql/opt_table_elimination.cc | |
parent | 9d4ad893801c37d34b63a8bb4181ff5530f8db95 (diff) | |
download | mariadb-git-01291632015057de4e56aeeef33c426a11959e55.tar.gz |
MWL#17: Table elimination
- More dbug printouts
- More testcases
Diffstat (limited to 'sql/opt_table_elimination.cc')
-rw-r--r-- | sql/opt_table_elimination.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc index a59151fc535..5d8b68f48b8 100644 --- a/sql/opt_table_elimination.cc +++ b/sql/opt_table_elimination.cc @@ -136,7 +136,8 @@ class Table_elimination; /* - A value. + A value, something that can be bound or not bound. Also, values can be linked + in a list. */ class Value_dep : public Sql_alloc @@ -203,7 +204,7 @@ public: /* - A 'module' + A 'module'. Module has dependencies */ class Module_dep : public Sql_alloc @@ -227,7 +228,6 @@ public: }; - /* A "tbl.column= expr" equality dependency. tbl.column depends on fields used in expr. @@ -333,6 +333,9 @@ Equality_module *merge_func_deps(Equality_module *start, Equality_module *new_fi static Table_value *get_table_value(Table_elimination *te, TABLE *table); static Field_value *get_field_value(Table_elimination *te, Field *field); +static Outer_join_module *get_outer_join_dep(Table_elimination *te, + TABLE_LIST *outer_join, + table_map deps_map); static void run_elimination_wave(Table_elimination *te, Module_dep *bound_modules); void eliminate_tables(JOIN *join); @@ -1212,15 +1215,19 @@ void run_elimination_wave(Table_elimination *te, Module_dep *bound_modules) - expressions that depend on us. */ Field_value *field_dep= (Field_value*)bound_values; + DBUG_PRINT("info", ("field %s.%s is now bound", + field_dep->field->table->alias, + field_dep->field->field_name)); + for (Key_module *key_dep= field_dep->table->keys; key_dep; key_dep= key_dep->next_table_key) { - DBUG_PRINT("info", ("key %s.%s is now bound", - key_dep->table->table->alias, - key_dep->table->table->key_info[key_dep->keyno].name)); if (field_dep->field->part_of_key.is_set(key_dep->keyno) && key_dep->unknown_args && !--key_dep->unknown_args) { + DBUG_PRINT("info", ("key %s.%s is now bound", + key_dep->table->table->alias, + key_dep->table->table->key_info[key_dep->keyno].name)); /* Mark as bound and add to the list */ key_dep->next= bound_modules; bound_modules= key_dep; |