lp:~prafulla-t/drizzle/dr-bug-592444
- Get this branch:
- bzr branch lp:~prafulla-t/drizzle/dr-bug-592444
Branch merges
- Patrick Crews: Approve
-
Diff: 521 lines (+361/-33)8 files modifieddrizzled/item.h (+5/-0)
drizzled/join.cc (+65/-20)
drizzled/nested_join.h (+10/-0)
drizzled/optimizer/range.cc (+5/-2)
drizzled/sql_select.cc (+8/-10)
drizzled/sql_select.h (+1/-1)
tests/r/optimizer.result (+141/-0)
tests/t/optimizer.test (+126/-0)
Related bugs
Related blueprints
Recent revisions
- 1646. By PrafullaT
-
Fix for Bug 592444
There were two problems:
o. In greedy_search optimizer method, best_extension_by_limited search
maintains join embedding(nestedness) of tables added so far, so that
correct(valid) join order is selected
These are requirements from nested outer join executioner.
The problem was, embedding_map was not correctly updated when a table
is added to optimal plan outside best_extension_by_limited search,
by greedy_search method. We need to update join->cur_embedding_ map
correctly here so that execution plan for other tables get
generated.
Invoked checked_interleaving_ with_nj from greedy_search on the
best_table selected. Fixed its prototype to take only one JoinTab
This is same as mysql 5.1 source tree.
o. The other problem was, join->cur_embedding_ map was not restored correctly
when a table is added to the optimal plan to reflect the current embedding
map.
Taken good documented method restore_prev_nj_ state which restores
cur_embedding_ map from mysql 5.1 source tree and modified it for drizzled
code. - 1643. By PrafullaT
-
This bug is simillar to mysql bug 36133
http://bugs.mysql. com/bug. php?id= 36133 Taking changes from that fix.
- The problem was that the range optimizer evaluated constant expressions,
and among them it would try to evaluate IN-subquery predicates slated for
handling with materialization strategy. However, these predicates require
that parent_join->setup_ subquery_ materialization () is invoked before one
attempts to evaluate them.- Fixed by making the range optimizer not to evaluate expressions that have
item->is_expensive( ) == TRUE (these are materialization subqueries and
stored function calls). This should also resolve the problem that EXPLAIN
may be too long.
This change cuts off some opportunities for range optimizer, but this is
the price we're willing to pay for separation of query optimization and
execution.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:~drizzle-trunk/drizzle/development