@@ -619,3 +619,26 @@ NULL NULL 2 2 4 2
619
619
show warnings;
620
620
Level Code Message
621
621
drop table if exists t1, t2, t3, t4;
622
+ drop table if exists t1, t2;
623
+ create table t1(a int, b int, index idx(a, b));
624
+ create table t2(a int, b int, index idx(a));
625
+ explain select /*+ merge_join(t1) */ * from t1 join t2 on t1.a=t2.a and t2.b=t1.b;
626
+ id estRows task access object operator info
627
+ MergeJoin_8 12475.01 root inner join, left key:test.t1.a, test.t1.b, right key:test.t2.a, test.t2.b
628
+ ├─Sort_19(Build) 9980.01 root test.t2.a, test.t2.b
629
+ │ └─TableReader_14 9980.01 root data:Selection_13
630
+ │ └─Selection_13 9980.01 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))
631
+ │ └─TableFullScan_12 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
632
+ └─IndexReader_11(Probe) 9980.01 root index:Selection_10
633
+ └─Selection_10 9980.01 cop[tikv] not(isnull(test.t1.b))
634
+ └─IndexFullScan_9 9990.00 cop[tikv] table:t1, index:idx(a, b) keep order:true, stats:pseudo
635
+ explain select /*+ no_hash_join(t1), no_index_join(t1,t2), no_index_hash_join(t1,t2) */ * from t1 join t2 on t1.a=t2.a and t2.b=t1.b;
636
+ id estRows task access object operator info
637
+ MergeJoin_8 12475.01 root inner join, left key:test.t1.a, test.t1.b, right key:test.t2.a, test.t2.b
638
+ ├─Sort_47(Build) 9980.01 root test.t2.a, test.t2.b
639
+ │ └─TableReader_42 9980.01 root data:Selection_41
640
+ │ └─Selection_41 9980.01 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))
641
+ │ └─TableFullScan_40 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
642
+ └─IndexReader_39(Probe) 9980.01 root index:Selection_38
643
+ └─Selection_38 9980.01 cop[tikv] not(isnull(test.t1.b))
644
+ └─IndexFullScan_37 9990.00 cop[tikv] table:t1, index:idx(a, b) keep order:true, stats:pseudo
0 commit comments