summaryrefslogtreecommitdiff
path: root/sql/sql_join_cache.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2010-06-08 18:22:31 +0400
committerSergey Petrunya <psergey@askmonty.org>2010-06-08 18:22:31 +0400
commit26c3dc455ba934db40d7ad409358c3605fa196d0 (patch)
tree86f61ab782e5f12c82f15eb1fece8ca25db1b9b9 /sql/sql_join_cache.cc
parent559dafdf608726a9e1fed92be269be2012fa2c6f (diff)
downloadmariadb-git-26c3dc455ba934db40d7ad409358c3605fa196d0.tar.gz
MWL#90: Subqueries: Inside-out execution for non-semijoin materialized subqueries that are AND-parts of the WHERE
- Address feedback - Code cleanup (not finished)
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r--sql/sql_join_cache.cc46
1 files changed, 8 insertions, 38 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index a4db80b29a1..5db5928fba1 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -158,42 +158,6 @@ JOIN_TAB *next_linear_tab(JOIN* join, JOIN_TAB* tab, bool include_bush_roots);
void JOIN_CACHE::calc_record_fields()
{
- //psergey4-todo: prev_cache, or
- // - first non-const table if on top level
- // - first table inside SJM nest if within sjm nest
- // this->join_tab is 'our' join_tab
-
- // No. the right idea: start from ... and walk to the current join_tab
- /// with an iterator, skipping
- // join nests (can do so for now)
-
- /*
- The above sucks, too.
- The right idea:
- - for SJM-inner tables, walk only within the nest
- - for SJM-outer tables, use all preceding tables, including inner ones.
- eof
- */
-
-/* JOIN_TAB *tab = prev_cache ? prev_cache->join_tab :
- join->join_tab+join->const_tables;
-*/
-
-/* JOIN_TAB *tab;
- if (prev_cache)
- tab= prev_cache->join_tab;
- else
- {
- if (tab->bush_root_tab)
- {
- ;
- }
- else
- {
- / * top-level * /
- tab= join->join_tab+join->const_tables;
- }
- }*/
JOIN_TAB *tab;
if (prev_cache)
tab= prev_cache->join_tab;
@@ -201,12 +165,18 @@ void JOIN_CACHE::calc_record_fields()
{
if (join_tab->bush_root_tab)
{
- // inside SJM-Mat nest: pick first one
+ /*
+ If the tab we're attached to is inside an SJM-nest, start from the
+ first tab in that SJM nest
+ */
tab= join_tab->bush_root_tab->bush_children->start;
}
else
{
- // outside SJM-Mat nest: start from first non-const table
+ /*
+ The tab we're attached to is not inside an SJM-nest. Start from the
+ first non-const table.
+ */
tab= join->join_tab + join->const_tables;
}
}