Commit graph

78 commits

Author SHA1 Message Date
Sergey Petrunya
46c9677628 Variable/function renames 2009-08-19 15:06:59 +03:00
Sergey Petrunya
c54370d3ff MWL#17: Table elimination
- Use Table_elimination only for functional dependency checking for
  individual objects and rename it to Func_dep_analyzer
2009-08-19 13:18:38 +03:00
Sergey Petrunya
eed5a47c34 More code cleanups 2009-08-19 01:19:48 +03:00
Sergey Petrunya
1396c2d2fa MWL#17: Table elimination
- Better comments
- Switch from "type" enum and switch to virtual functions for member funcs.
2009-08-19 00:18:10 +03:00
Sergey Petrunya
307a6ba5ee MWL#17: Table elimination
- Code cleanup
2009-08-18 18:01:51 +03:00
Sergey Petrunya
c1b69e72eb MWL#17: Table elimination
- Switch from trying to eliminate all tables at once (which didn't work)
  to the original approach of bottom-up elimination.
2009-08-18 16:03:58 +03:00
Sergey Petrunya
441434e565 MWL#17: Table elimination
- More dbug printouts
- More testcases
2009-08-17 18:02:29 +03:00
Sergey Petrunya
a14b5d2466 MWL#17: Table elimination
- More comments
2009-08-16 21:01:59 +03:00
Sergey Petrunya
69d4559eed MWL#17: Table elimination
- Better comments
- More OOM checks

sql/sql_select.cc:
  - Remove garbage code
2009-08-16 17:35:47 +03:00
Sergey Petrunya
e845f0f82f - Better comments
- Add OOM error checking
2009-08-16 15:43:31 +03:00
Sergey Petrunya
f260de5c07 MWL#17: Table elimination
- Address review feedback: change expression analyzer used to be a copy-paste
  of ref analyzer. ref analyzer, besides doing ref analysis, also collected 
  info about keys which had sargable predicates. We didn't need that part here.
2009-08-16 15:17:08 +03:00
Sergey Petrunya
b70cb552e5 MWL#17: Table elimination
- code cleanup
2009-08-16 12:15:49 +03:00
Sergey Petrunya
8c00930642 MWL#17: Table elimination
- Fix trivial valgrind failures that shown up after review
2009-08-16 10:25:24 +03:00
Sergey Petrunya
405a36ae39 MWL#17: Table elimination
- Review feedback, more variable renames
2009-08-15 18:39:12 +03:00
Sergey Petrunya
76071c8fbd Fix trivial typo 2009-08-15 16:14:42 +04:00
Sergey Petrunya
85b63c1e67 MWL#17: Table elimination
Continue with addressing review feedback part two: 
- rename enum members
- add checking for out of memory errors on allocation
2009-08-15 14:29:53 +04:00
Sergey Petrunya
ef67ab4d8b MWL#17: Address 2nd post-review feedback
- Switch from uniform graph to bipartite graph with two kinds of nodes:
  "values" (tables and fields) and "modules" (t.col=func(...) equalities, 
  multi-equalities, unique keys, inner sides of outer joins).
- Rename functions, classes, etc.
2009-08-15 10:08:03 +04:00
Sergey Petrunya
fef409cb9e MWL#17: Table elimination
- More function renames, added comments
2009-08-14 00:44:52 +04:00
Sergey Petrunya
a28390364b MWL#17: Table elimination
- Better comments

sql/sql_select.cc:
  MWL#17: Table elimination
  - Fix buildbot failure: do set correct value to nested_join::n_tables
2009-08-13 23:10:53 +04:00
Sergey Petrunya
536754c8c6 MWL#17: Table elimination
Fixes after post-review fixes:
- Don't search for tables in JOIN_TAB array. it's not initialized yet.
  use select_lex->leaf_tables instead.
2009-08-13 13:36:13 +04:00
Sergey Petrunya
40bb97b525 MWL#17: Table elimination
- When making inferences "field is bound" -> "key is bound", do check 
  that the field is part of the key
2009-08-13 04:01:43 +04:00
Sergey Petrunya
b032c7d833 MWL#17: Table elimination
- Continue addressing review feedback: remove "unusable KEYUSEs" 
  extension as it is no longer needed.

sql/item.h:
  MWL#17: Table elimination
  - Code cleanup
sql/opt_table_elimination.cc:
  MWL#17: Table elimination
  - Code cleanup
2009-08-13 03:43:02 +04:00
Sergey Petrunya
854bb82bd8 MWL#17: Table elimination
Address review feedback: 
- Change from Wave-based approach (a-la const table detection) to 
  building and walking functional dependency graph.
- Change from piggy-backing on ref-access code and KEYUSE structures
  to using our own expression analyzer.


sql/item.cc:
  MWL#17: Table elimination
  - Move from C-ish Field_processor_info to C++ ish and generic Field_enumerator
sql/item.h:
  MWL#17: Table elimination
  - Move from C-ish Field_processor_info to C++ ish and generic Field_enumerator
sql/sql_bitmap.h:
  MWL#17: Table elimination
  - Backport of Table_map_iterator from 6.0
2009-08-13 02:34:21 +04:00
Sergey Petrunya
7b3d464578 MWL#17: Table elimination
- More comments
- Renove old code
2009-06-30 17:20:18 +04:00
Sergey Petrunya
8156d9eb0a MWL#17: Table elimination
- Last fixes

sql/item.cc:
  MWL#17: Table elimination
  - Don't make multiple calls of ::walk(check_column_usage_processor),
    call once and cache the value
sql/item.h:
  MWL#17: Table elimination
  - s/KEYUSE::usable/KEYUSE::type/, more comments
sql/opt_table_elimination.cc:
  MWL#17: Table elimination
  - Don't make multiple calls of ::walk(check_column_usage_processor),
    call once and cache the value
sql/sql_select.cc:
  MWL#17: Table elimination
  - s/KEYUSE::usable/KEYUSE::type/, more comments
sql/sql_select.h:
  MWL#17: Table elimination
  - s/KEYUSE::usable/KEYUSE::type/, more comments
sql/table.h:
  MWL#17: Table elimination
  - Better comments
2009-06-30 17:11:00 +04:00
Sergey Petrunya
9fa1bce436 MWL#17: Table elimination
mysql-test/r/table_elim.result:
  MWL#17: Table elimination
  - More tests
mysql-test/t/table_elim.test:
  MWL#17: Table elimination
  - More tests
sql/opt_table_elimination.cc:
  MWL#17: Table elimination
  - Code cleanup
sql/sql_select.cc:
  MWL#17: Table elimination
  - Code cleanup
sql/sql_select.h:
  MWL#17: Table elimination
  - Code cleanup
sql/table.h:
  MWL#17: Table elimination
  - Code cleanup
2009-06-29 17:51:15 +04:00
Sergey Petrunia
d764108a2c MWL#17: Table elimination
- Better comments, variable/function renames
2009-06-26 00:07:29 +04:00
Sergey Petrunia
4102605fba MWL#17: Table elimination
- Moved table elimination code to sql/opt_table_elimination.cc
- Added comments 

.bzrignore:
  MWL#17: Table elimination
  - Moved table elimination code to sql/opt_table_elimination.cc
libmysqld/Makefile.am:
  MWL#17: Table elimination
  - Moved table elimination code to sql/opt_table_elimination.cc
sql/CMakeLists.txt:
  MWL#17: Table elimination
  - Moved table elimination code to sql/opt_table_elimination.cc
sql/Makefile.am:
  MWL#17: Table elimination
  - Moved table elimination code to sql/opt_table_elimination.cc
2009-06-25 14:05:53 +04:00