List:Commits« Previous MessageNext Message »
From:Jan Wedvik Date:June 7 2011 12:26pm
Subject:bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch
(jan.wedvik:3501)
View as plain text  
#At file:///net/atum17/export/home/tmp/jw159207/mysql/repo/push-scan-scan/ based on revid:jan.wedvik@stripped

 3501 Jan Wedvik	2011-06-07
      This commit adds a regression test case for http://lists.mysql.com/commits/138760 (mysql-5.1-telco-7.0 revno 4441,
      bushy scan with pruning).

    modified:
      mysql-test/suite/ndb/r/ndb_join_pushdown.result
      mysql-test/suite/ndb/t/ndb_join_pushdown.test
=== modified file 'mysql-test/suite/ndb/r/ndb_join_pushdown.result'
--- a/mysql-test/suite/ndb/r/ndb_join_pushdown.result	2011-05-26 15:13:05 +0000
+++ b/mysql-test/suite/ndb/r/ndb_join_pushdown.result	2011-06-07 12:26:02 +0000
@@ -2057,6 +2057,19 @@ left join tx as x2 on x1.c=x2.a and x1.d
 count(*)
 304
 drop table tx;
+alter table t1 partition by key(a);
+explain select count(*) from t1 
+join t1 as t2 on t2.a = t1.c 
+join t1 as t3 on t3.a = t1.c;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	16	Parent of 3 pushed join@1
+1	SIMPLE	t2	ref	PRIMARY	PRIMARY	4	test.t1.c	1	Child of 't1' in pushed join@1
+1	SIMPLE	t3	ref	PRIMARY	PRIMARY	4	test.t1.c	1	Child of 't1' in pushed join@1
+select count(*) from t1 
+join t1 as t2 on t2.a = t1.c 
+join t1 as t3 on t3.a = t1.c;
+count(*)
+208
 drop table t1;
 create table t1 (a int, b int, primary key(a) using hash) engine = ndb;
 insert into t1 values (1, 2);
@@ -5156,13 +5169,13 @@ and spj_counts_at_end.counter_name <> 'L
        and spj_counts_at_end.counter_name <> 'SCAN_BATCHES_RETURNED';
 counter_name	spj_counts_at_end.val - spj_counts_at_startup.val
 CONST_PRUNED_RANGE_SCANS_RECEIVED	6
-LOCAL_TABLE_SCANS_SENT	232
-PRUNED_RANGE_SCANS_RECEIVED	17
+LOCAL_TABLE_SCANS_SENT	234
+PRUNED_RANGE_SCANS_RECEIVED	21
 RANGE_SCANS_RECEIVED	720
 READS_NOT_FOUND	6616
 READS_RECEIVED	52
-SCAN_ROWS_RETURNED	94233
-TABLE_SCANS_RECEIVED	232
+SCAN_ROWS_RETURNED	94353
+TABLE_SCANS_RECEIVED	234
 select sum(spj_counts_at_end.val - spj_counts_at_startup.val) as 'LOCAL+REMOTE READS_SENT'
        from spj_counts_at_end, spj_counts_at_startup 
 where spj_counts_at_end.counter_name = spj_counts_at_startup.counter_name
@@ -5173,15 +5186,15 @@ LOCAL+REMOTE READS_SENT
 drop table spj_counts_at_startup;
 drop table spj_counts_at_end;
 scan_count
-2555
+2562
 pruned_scan_count
 8
 sorted_scan_count
 10
 pushed_queries_defined
-379
+381
 pushed_queries_dropped
 11
 pushed_queries_executed
-532
+533
 set ndb_join_pushdown = @save_ndb_join_pushdown;

=== modified file 'mysql-test/suite/ndb/t/ndb_join_pushdown.test'
--- a/mysql-test/suite/ndb/t/ndb_join_pushdown.test	2011-05-26 15:13:05 +0000
+++ b/mysql-test/suite/ndb/t/ndb_join_pushdown.test	2011-06-07 12:26:02 +0000
@@ -996,6 +996,17 @@ select count(*) from tx as x1 
   left join tx as x2 on x1.c=x2.a and x1.d=x2.d;
 
 drop table tx;
+
+# Test bushy join with pruned scan.
+alter table t1 partition by key(a);
+
+explain select count(*) from t1 
+  join t1 as t2 on t2.a = t1.c 
+  join t1 as t3 on t3.a = t1.c;
+select count(*) from t1 
+  join t1 as t2 on t2.a = t1.c 
+  join t1 as t3 on t3.a = t1.c;
+
 drop table t1;
 
 


Attachment: [text/bzr-bundle] bzr/jan.wedvik@oracle.com-20110607122602-mh1ynpusoxfysa1q.bundle
Thread
bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch(jan.wedvik:3501) Jan Wedvik7 Jun