Skip to content

Commit

Permalink
planner: pick some codes from #8929 (#11829)
Browse files Browse the repository at this point in the history
  • Loading branch information
winoros authored and sre-bot committed Aug 22, 2019
1 parent a9815a6 commit 4e67be8
Show file tree
Hide file tree
Showing 12 changed files with 184 additions and 162 deletions.
6 changes: 3 additions & 3 deletions cmd/explaintest/r/explain_complex.result
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ id count task operator info
Projection_9 0.00 root test.dt.id, test.dt.aid, test.dt.pt, test.dt.dic, test.dt.cm, test.rr.gid, test.rr.acd, test.rr.t, test.dt.p1, test.dt.p2, test.dt.p3, test.dt.p4, test.dt.p5, test.dt.p6_md5, test.dt.p7_md5
└─Limit_12 0.00 root offset:0, count:2000
└─IndexJoin_18 0.00 root inner join, inner:IndexLookUp_17, outer key:test.dt.aid, test.dt.dic, inner key:test.rr.aid, test.rr.dic
├─TableReader_38 0.00 root data:Selection_37
│ └─Selection_37 0.00 cop eq(test.dt.bm, 0), eq(test.dt.pt, "ios"), gt(test.dt.t, 1478185592)
│ └─TableScan_36 10000.00 cop table:dt, range:[0,+inf], keep order:false, stats:pseudo
├─TableReader_40 0.00 root data:Selection_39
│ └─Selection_39 0.00 cop eq(test.dt.bm, 0), eq(test.dt.pt, "ios"), gt(test.dt.t, 1478185592)
│ └─TableScan_38 10000.00 cop table:dt, range:[0,+inf], keep order:false, stats:pseudo
└─IndexLookUp_17 0.00 root
├─IndexScan_14 10.00 cop table:rr, index:aid, dic, range: decided by [test.dt.aid test.dt.dic], keep order:false, stats:pseudo
└─Selection_16 0.00 cop eq(test.rr.pt, "ios"), gt(test.rr.t, 1478185592)
Expand Down
6 changes: 3 additions & 3 deletions cmd/explaintest/r/explain_complex_stats.result
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ id count task operator info
Projection_9 428.32 root test.dt.id, test.dt.aid, test.dt.pt, test.dt.dic, test.dt.cm, test.rr.gid, test.rr.acd, test.rr.t, test.dt.p1, test.dt.p2, test.dt.p3, test.dt.p4, test.dt.p5, test.dt.p6_md5, test.dt.p7_md5
└─Limit_12 428.32 root offset:0, count:2000
└─IndexJoin_18 428.32 root inner join, inner:IndexLookUp_17, outer key:test.dt.aid, test.dt.dic, inner key:test.rr.aid, test.rr.dic
├─TableReader_38 428.32 root data:Selection_37
│ └─Selection_37 428.32 cop eq(test.dt.bm, 0), eq(test.dt.pt, "ios"), gt(test.dt.t, 1478185592)
│ └─TableScan_36 2000.00 cop table:dt, range:[0,+inf], keep order:false
├─TableReader_40 428.32 root data:Selection_39
│ └─Selection_39 428.32 cop eq(test.dt.bm, 0), eq(test.dt.pt, "ios"), gt(test.dt.t, 1478185592)
│ └─TableScan_38 2000.00 cop table:dt, range:[0,+inf], keep order:false
└─IndexLookUp_17 0.48 root
├─IndexScan_14 1.00 cop table:rr, index:aid, dic, range: decided by [test.dt.aid test.dt.dic], keep order:false
└─Selection_16 0.48 cop eq(test.rr.pt, "ios"), gt(test.rr.t, 1478185592)
Expand Down
13 changes: 7 additions & 6 deletions cmd/explaintest/r/explain_easy.result
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ IndexReader_6 10.00 root index:IndexScan_5
explain select * from t1 left join t2 on t1.c2 = t2.c1 where t1.c1 > 1;
id count task operator info
IndexJoin_11 4166.67 root left outer join, inner:IndexLookUp_10, outer key:test.t1.c2, inner key:test.t2.c1
├─TableReader_23 3333.33 root data:TableScan_22
│ └─TableScan_22 3333.33 cop table:t1, range:(1,+inf], keep order:false, stats:pseudo
├─TableReader_25 3333.33 root data:TableScan_24
│ └─TableScan_24 3333.33 cop table:t1, range:(1,+inf], keep order:false, stats:pseudo
└─IndexLookUp_10 10.00 root
├─IndexScan_8 10.00 cop table:t2, index:c1, range: decided by [test.t1.c2], keep order:false, stats:pseudo
└─TableScan_9 10.00 cop table:t2, keep order:false, stats:pseudo
Expand Down Expand Up @@ -115,10 +115,11 @@ Projection_12 10000.00 root eq(test.t1.c2, test.t2.c2)
├─TableReader_16 10000.00 root data:TableScan_15
│ └─TableScan_15 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo
└─Limit_21 1.00 root offset:0, count:1
└─IndexLookUp_43 1.00 root
├─Limit_42 1.00 cop offset:0, count:1
│ └─IndexScan_40 1.25 cop table:t2, index:c1, range: decided by [eq(test.t1.c1, test.t2.c1)], keep order:true, stats:pseudo
└─TableScan_41 1.00 cop table:t2, keep order:false, stats:pseudo
└─Projection_44 1.00 root test.t2.c1, test.t2.c2
└─IndexLookUp_43 1.00 root
├─Limit_42 1.00 cop offset:0, count:1
│ └─IndexScan_40 1.25 cop table:t2, index:c1, range: decided by [eq(test.t1.c1, test.t2.c1)], keep order:true, stats:pseudo
└─TableScan_41 1.00 cop table:t2, keep order:false, stats:pseudo
explain select * from t1 order by c1 desc limit 1;
id count task operator info
Limit_10 1.00 root offset:0, count:1
Expand Down
27 changes: 14 additions & 13 deletions cmd/explaintest/r/explain_easy_stats.result
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ IndexReader_6 0.00 root index:IndexScan_5
└─IndexScan_5 0.00 cop table:t1, index:c2, range:[1,1], keep order:false
explain select * from t1 left join t2 on t1.c2 = t2.c1 where t1.c1 > 1;
id count task operator info
Projection_6 2481.25 root test.t1.c1, test.t1.c2, test.t1.c3, test.t2.c1, test.t2.c2
└─MergeJoin_7 2481.25 root left outer join, left key:test.t1.c2, right key:test.t2.c1
├─IndexLookUp_17 1998.00 root
│ ├─Selection_16 1998.00 cop gt(test.t1.c1, 1)
│ │ └─IndexScan_14 1999.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:true
│ └─TableScan_15 1998.00 cop table:t1, keep order:false, stats:pseudo
└─IndexLookUp_21 1985.00 root
├─IndexScan_19 1985.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:true
└─TableScan_20 1985.00 cop table:t2, keep order:false
MergeJoin_7 2481.25 root left outer join, left key:test.t1.c2, right key:test.t2.c1
├─IndexLookUp_17 1998.00 root
│ ├─Selection_16 1998.00 cop gt(test.t1.c1, 1)
│ │ └─IndexScan_14 1999.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:true
│ └─TableScan_15 1998.00 cop table:t1, keep order:false, stats:pseudo
└─Projection_23 1985.00 root test.t2.c1, test.t2.c2
└─IndexLookUp_22 1985.00 root
├─IndexScan_20 1985.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:true
└─TableScan_21 1985.00 cop table:t2, keep order:false
explain update t1 set t1.c2 = 2 where t1.c1 = 1;
id count task operator info
Point_Get_1 1.00 root table:t1, handle:1
Expand Down Expand Up @@ -103,10 +103,11 @@ Projection_12 1999.00 root eq(test.t1.c2, test.t2.c2)
├─TableReader_16 1999.00 root data:TableScan_15
│ └─TableScan_15 1999.00 cop table:t1, range:[-inf,+inf], keep order:false
└─Limit_21 1.00 root offset:0, count:1
└─IndexLookUp_43 1.00 root
├─Limit_42 1.00 cop offset:0, count:1
│ └─IndexScan_40 1.25 cop table:t2, index:c1, range: decided by [eq(test.t1.c1, test.t2.c1)], keep order:true
└─TableScan_41 1.00 cop table:t2, keep order:false, stats:pseudo
└─Projection_44 1.00 root test.t2.c1, test.t2.c2
└─IndexLookUp_43 1.00 root
├─Limit_42 1.00 cop offset:0, count:1
│ └─IndexScan_40 1.25 cop table:t2, index:c1, range: decided by [eq(test.t1.c1, test.t2.c1)], keep order:true
└─TableScan_41 1.00 cop table:t2, keep order:false, stats:pseudo
explain select * from t1 order by c1 desc limit 1;
id count task operator info
Limit_10 1.00 root offset:0, count:1
Expand Down
4 changes: 2 additions & 2 deletions cmd/explaintest/r/index_join.result
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ IndexJoin_14 5.00 root inner join, inner:IndexLookUp_13, outer key:test.t2.a, in
├─IndexLookUp_13 5.00 root
│ ├─IndexScan_11 5.00 cop table:t1, index:a, range: decided by [test.t2.a], keep order:false
│ └─TableScan_12 5.00 cop table:t1, keep order:false
└─TableReader_26 1.00 root data:TableScan_25
└─TableScan_25 1.00 cop table:t2, range:[-inf,+inf], keep order:false
└─TableReader_28 1.00 root data:TableScan_27
└─TableScan_27 1.00 cop table:t2, range:[-inf,+inf], keep order:false
18 changes: 9 additions & 9 deletions cmd/explaintest/r/topn_push_down.result
Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,20 @@ LIMIT 0, 5;
id count task operator info
Projection_13 0.00 root test.te.expected_time
└─Limit_19 0.00 root offset:0, count:5
└─IndexJoin_91 0.00 root left outer join, inner:IndexReader_90, outer key:test.tr.id, inner key:test.p.relate_id
├─TopN_94 0.00 root test.te.expect_time:asc, offset:0, count:5
└─IndexJoin_92 0.00 root left outer join, inner:IndexReader_91, outer key:test.tr.id, inner key:test.p.relate_id
├─TopN_95 0.00 root test.te.expect_time:asc, offset:0, count:5
│ └─IndexJoin_35 0.00 root inner join, inner:IndexLookUp_34, outer key:test.tr.id, inner key:test.te.trade_id
│ ├─IndexLookUp_73 0.00 root
│ │ ├─Selection_71 0.00 cop eq(test.tr.business_type, 18), in(test.tr.trade_type, 1)
│ │ │ └─IndexScan_69 10.00 cop table:tr, index:shop_identy, trade_status, business_type, trade_pay_status, trade_type, delivery_type, source, biz_date, range:[810094178,810094178], keep order:false, stats:pseudo
│ │ └─Selection_72 0.00 cop eq(test.tr.brand_identy, 32314), eq(test.tr.domain_type, 2)
│ │ └─TableScan_70 0.00 cop table:tr, keep order:false, stats:pseudo
│ ├─IndexLookUp_74 0.00 root
│ │ ├─Selection_72 0.00 cop eq(test.tr.business_type, 18), in(test.tr.trade_type, 1)
│ │ │ └─IndexScan_70 10.00 cop table:tr, index:shop_identy, trade_status, business_type, trade_pay_status, trade_type, delivery_type, source, biz_date, range:[810094178,810094178], keep order:false, stats:pseudo
│ │ └─Selection_73 0.00 cop eq(test.tr.brand_identy, 32314), eq(test.tr.domain_type, 2)
│ │ └─TableScan_71 0.00 cop table:tr, keep order:false, stats:pseudo
│ └─IndexLookUp_34 0.25 root
│ ├─IndexScan_31 10.00 cop table:te, index:trade_id, range: decided by [test.tr.id], keep order:false, stats:pseudo
│ └─Selection_33 0.25 cop ge(test.te.expect_time, 2018-04-23 00:00:00.000000), le(test.te.expect_time, 2018-04-23 23:59:59.000000)
│ └─TableScan_32 10.00 cop table:te, keep order:false, stats:pseudo
└─IndexReader_90 10.00 root index:IndexScan_89
└─IndexScan_89 10.00 cop table:p, index:relate_id, range: decided by [test.tr.id], keep order:false, stats:pseudo
└─IndexReader_91 10.00 root index:IndexScan_90
└─IndexScan_90 10.00 cop table:p, index:relate_id, range: decided by [test.tr.id], keep order:false, stats:pseudo
desc select 1 as a from dual order by a limit 1;
id count task operator info
Projection_6 1.00 root 1
Expand Down
Loading

0 comments on commit 4e67be8

Please sign in to comment.