List:Commits« Previous MessageNext Message »
From:Ole John Aske Date:April 27 2012 10:13am
Subject:bzr push into mysql-trunk-cluster branch (ole.john.aske:3476 to 3477)
View as plain text  
 3477 Ole John Aske	2012-04-27
      Fixed JSON explain of pushed joins + added testcase.

    modified:
      mysql-test/suite/ndb/r/ndb_join_pushdown_default.result
      mysql-test/suite/ndb/r/ndb_join_pushdown_nobnl.result
      mysql-test/suite/ndb/t/ndb_join_pushdown.inc
      sql/opt_explain_json.cc
 3476 magnus.blaudd@stripped	2012-04-13 [merge]
      Merge

    modified:
      storage/ndb/compile-cluster
=== modified file 'mysql-test/suite/ndb/r/ndb_join_pushdown_default.result'
--- a/mysql-test/suite/ndb/r/ndb_join_pushdown_default.result	2012-04-11 08:59:27 +0000
+++ b/mysql-test/suite/ndb/r/ndb_join_pushdown_default.result	2012-04-27 10:12:58 +0000
@@ -53,6 +53,55 @@ a	b	c	d	a	b	c	d
 4	1	4	5	1	4	2	3
 4	3	1	2	3	1	1	2
 4	4	4	4	4	4	4	4
+explain format=JSON
+select *
+from t1
+join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
+EXPLAIN
+{
+  "query_block": {
+    "select_id": 1,
+    "nested_loop": [
+      {
+        "table": {
+          "table_name": "t1",
+          "partitions": [
+            "p0",
+            "p1"
+          ],
+          "access_type": "ALL",
+          "rows": 16,
+          "filtered": 100,
+          "pushed_join": "Parent of 2 pushed join@1"
+        }
+      },
+      {
+        "table": {
+          "table_name": "t2",
+          "partitions": [
+            "p0",
+            "p1"
+          ],
+          "access_type": "eq_ref",
+          "possible_keys": [
+            "PRIMARY"
+          ],
+          "key": "PRIMARY",
+          "key_length": "8",
+          "ref": [
+            "test.t1.b",
+            "test.t1.c"
+          ],
+          "rows": 1,
+          "filtered": 100,
+          "pushed_join": "Child of 't1' in pushed join@1"
+        }
+      }
+    ]
+  }
+}
+Warnings:
+Note	1003	/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
 explain extended 
 select straight_join count(*) 
 from t1 as x1 
@@ -5533,7 +5582,7 @@ where new.variable_name = old.variable_n
 order by new.variable_name;
 variable_name	new.variable_value - old.variable_value
 NDB_PRUNED_SCAN_COUNT	8
-NDB_PUSHED_QUERIES_DEFINED	398
+NDB_PUSHED_QUERIES_DEFINED	399
 NDB_PUSHED_QUERIES_DROPPED	7
 NDB_PUSHED_QUERIES_EXECUTED	545
 NDB_SORTED_SCAN_COUNT	11

=== modified file 'mysql-test/suite/ndb/r/ndb_join_pushdown_nobnl.result'
--- a/mysql-test/suite/ndb/r/ndb_join_pushdown_nobnl.result	2012-04-11 08:59:27 +0000
+++ b/mysql-test/suite/ndb/r/ndb_join_pushdown_nobnl.result	2012-04-27 10:12:58 +0000
@@ -54,6 +54,55 @@ a	b	c	d	a	b	c	d
 4	1	4	5	1	4	2	3
 4	3	1	2	3	1	1	2
 4	4	4	4	4	4	4	4
+explain format=JSON
+select *
+from t1
+join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
+EXPLAIN
+{
+  "query_block": {
+    "select_id": 1,
+    "nested_loop": [
+      {
+        "table": {
+          "table_name": "t1",
+          "partitions": [
+            "p0",
+            "p1"
+          ],
+          "access_type": "ALL",
+          "rows": 16,
+          "filtered": 100,
+          "pushed_join": "Parent of 2 pushed join@1"
+        }
+      },
+      {
+        "table": {
+          "table_name": "t2",
+          "partitions": [
+            "p0",
+            "p1"
+          ],
+          "access_type": "eq_ref",
+          "possible_keys": [
+            "PRIMARY"
+          ],
+          "key": "PRIMARY",
+          "key_length": "8",
+          "ref": [
+            "test.t1.b",
+            "test.t1.c"
+          ],
+          "rows": 1,
+          "filtered": 100,
+          "pushed_join": "Child of 't1' in pushed join@1"
+        }
+      }
+    ]
+  }
+}
+Warnings:
+Note	1003	/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t1` `t2` where ((`test`.`t2`.`b` = `test`.`t1`.`c`) and (`test`.`t2`.`a` = `test`.`t1`.`b`))
 explain extended 
 select straight_join count(*) 
 from t1 as x1 
@@ -5528,7 +5577,7 @@ where new.variable_name = old.variable_n
 order by new.variable_name;
 variable_name	new.variable_value - old.variable_value
 NDB_PRUNED_SCAN_COUNT	8
-NDB_PUSHED_QUERIES_DEFINED	406
+NDB_PUSHED_QUERIES_DEFINED	407
 NDB_PUSHED_QUERIES_DROPPED	7
 NDB_PUSHED_QUERIES_EXECUTED	569
 NDB_SORTED_SCAN_COUNT	11

=== modified file 'mysql-test/suite/ndb/t/ndb_join_pushdown.inc'
--- a/mysql-test/suite/ndb/t/ndb_join_pushdown.inc	2012-03-29 10:38:31 +0000
+++ b/mysql-test/suite/ndb/t/ndb_join_pushdown.inc	2012-04-27 10:12:58 +0000
@@ -68,6 +68,12 @@ select *
 from t1
 join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
 
+# Check that new JSON explain format is also handled:
+explain format=JSON
+select *
+from t1
+join t1 as t2 on t2.a = t1.b and t2.b = t1.c;
+
 # Check that we do not push an operation if this prevents us from using
 # 'join buffer'.
 explain extended 

=== modified file 'sql/opt_explain_json.cc'
--- a/sql/opt_explain_json.cc	2012-03-28 18:48:25 +0000
+++ b/sql/opt_explain_json.cc	2012-04-27 10:12:58 +0000
@@ -54,7 +54,7 @@ static const char *json_extra_tags[ET_to
   "unique_row_not_found",               // ET_UNIQUE_ROW_NOT_FOUND
   "impossible_on_condition",            // ET_IMPOSSIBLE_ON_CONDITION
 #ifndef MCP_WL4784
-  NULL                                  // ET_PUSHED_JOIN
+  "pushed_join"                         // ET_PUSHED_JOIN
 #endif
 };
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-cluster branch (ole.john.aske:3476 to 3477) Ole John Aske27 Apr