List:Commits« Previous MessageNext Message »
From:Ole John Aske Date:April 27 2011 8:17am
Subject:bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch
(ole.john.aske:3480 to 3481)
View as plain text  
 3481 Ole John Aske	2011-04-27
      SPJ: Remove compiler warning about 'unused parent_no' 

 3480 Ole John Aske	2011-04-27
      SPJ: Mayor refactoring of and the logic which build 
      the pushed query (or: NdbQueryDef).
      Previously the NdbQueryDef was build incremenataly as we analyzed the query 
      plan for pushable operations. This had the disadvantage that we could take 
      descission about parent - child relations at this stage which later prevented
      other child candidates to be appended to the pushed query.
      This refactoring extends 'class ndb_pushed_builder_ctx' such that it
      collects intermediate information about pushable operation, and possible
      parent candidates for each child operation. Furthermore, it 
      breaks the pushability logic into multiple passes:
      1 ANALYZE:
          Analyze each child candidate and add it to 
          'ndb_pushed_builder_ctx::m_join_scope' as 
          'pushable' if it qualifies as such. In addition possible parent
          candidates, and required (forced) parent dependencies are collected
          for each table. All non pushable operations should be identified 
          during this pass such that only known pushable operations remains.
      2 OPTIMIZE:
          Determine the parent to be used among the set of possible
          parents. This is decided based on simple heuristic where
          the goal is to employ conditional filters as soon as possible,  
          reduce the fanout of intermediate results, and utilize
          the parallelism of the SPJ block whenever considdered optimal.
      3 BUILD:
          Build the NdbQueryDef.
      The primary goal of this refactoring has been to provide a better platform 
      for later improving the efficiency of the pushed queries being produced.
      It has not been the goal of this refactoring to change the pushability
      of any query in the existing MTR testsuite. However a few queries has improved
      its pushability as the 'analyze' phase now are able to force an artificial 
      sequential dependency between tables which enables more child operations to be 
      appended to the pushed query.

=== modified file 'sql/'
--- a/sql/	2011-04-27 07:42:18 +0000
+++ b/sql/	2011-04-27 08:16:37 +0000
@@ -1075,9 +1075,6 @@ ndb_pushed_builder_ctx::build_key(const 
-    const uint parent_no= m_tables[tab_no].m_parent;
-    DBUG_ASSERT(parent_no!=MAX_TABLES);
     const Item* join_items[ndb_pushed_join::MAX_LINKED_KEYS+1];
@@ -1196,6 +1193,7 @@ ndb_pushed_builder_ctx::build_query()
     if (table != m_join_root)
+      DBUG_ASSERT(m_tables[tab_no].m_parent!=MAX_TABLES);
       const uint parent_no= m_tables[tab_no].m_parent;
       const AQP::Table_access* parent= m_plan.get_table_access(parent_no);

No bundle (reason: useless for push emails).
bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch(ole.john.aske:3480 to 3481) Ole John Aske27 Apr