Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pingcap/tidb into windowexec
Browse files Browse the repository at this point in the history
  • Loading branch information
alivxxx committed Jan 15, 2019
2 parents 3f1c831 + f18e034 commit 85f4efe
Show file tree
Hide file tree
Showing 86 changed files with 1,695 additions and 725 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ check-slow:tools/bin/gometalinter tools/bin/gosec

errcheck:tools/bin/errcheck
@echo "errcheck"
@$(GO) mod vendor
@tools/bin/errcheck -exclude ./tools/check/errcheck_excludes.txt -blank $(PACKAGES) | grep -v "_test\.go" | awk '{print} END{if(NR>0) {exit 1}}'
@GO111MODULE=on tools/bin/errcheck -exclude ./tools/check/errcheck_excludes.txt -blank $(PACKAGES) | grep -v "_test\.go" | awk '{print} END{if(NR>0) {exit 1}}'

lint:tools/bin/revive
@echo "linting"
Expand Down
9 changes: 3 additions & 6 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_10 0.00 root dt.id, dt.aid, dt.pt, dt.dic, dt.cm, rr.gid, rr.acd, rr.t, dt.p1, dt.p2, dt.p3, dt.p4, dt.p5, dt.p6_md5, dt.p7_md5
└─Limit_13 0.00 root offset:0, count:2000
└─IndexJoin_19 0.00 root inner join, inner:IndexLookUp_18, outer key:dt.aid, dt.dic, inner key:rr.aid, rr.dic
├─TableReader_43 0.00 root data:Selection_42
│ └─Selection_42 0.00 cop eq(dt.bm, 0), eq(dt.pt, "ios"), gt(dt.t, 1478185592)
│ └─TableScan_41 10000.00 cop table:dt, range:[0,+inf], keep order:false, stats:pseudo
├─TableReader_45 0.00 root data:Selection_44
│ └─Selection_44 0.00 cop eq(dt.bm, 0), eq(dt.pt, "ios"), gt(dt.t, 1478185592)
│ └─TableScan_43 10000.00 cop table:dt, range:[0,+inf], keep order:false, stats:pseudo
└─IndexLookUp_18 3.33 root
├─IndexScan_15 10.00 cop table:rr, index:aid, dic, range: decided by [dt.aid dt.dic], keep order:false, stats:pseudo
└─Selection_17 3.33 cop eq(rr.pt, "ios"), gt(rr.t, 1478185592)
Expand Down Expand Up @@ -200,6 +200,3 @@ HashAgg_34 72000.00 root group by:col_1, funcs:sum(col_0)
│ └─TableScan_58 10000.00 cop table:tbl_008, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_62 10000.00 root data:TableScan_61
└─TableScan_61 10000.00 cop table:tbl_009, range:[-inf,+inf], keep order:false, stats:pseudo



9 changes: 3 additions & 6 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_10 428.32 root dt.id, dt.aid, dt.pt, dt.dic, dt.cm, rr.gid, rr.acd, rr.t, dt.p1, dt.p2, dt.p3, dt.p4, dt.p5, dt.p6_md5, dt.p7_md5
└─Limit_13 428.32 root offset:0, count:2000
└─IndexJoin_19 428.32 root inner join, inner:IndexLookUp_18, outer key:dt.aid, dt.dic, inner key:rr.aid, rr.dic
├─TableReader_43 428.32 root data:Selection_42
│ └─Selection_42 428.32 cop eq(dt.bm, 0), eq(dt.pt, "ios"), gt(dt.t, 1478185592)
│ └─TableScan_41 2000.00 cop table:dt, range:[0,+inf], keep order:false
├─TableReader_45 428.32 root data:Selection_44
│ └─Selection_44 428.32 cop eq(dt.bm, 0), eq(dt.pt, "ios"), gt(dt.t, 1478185592)
│ └─TableScan_43 2000.00 cop table:dt, range:[0,+inf], keep order:false
└─IndexLookUp_18 970.00 root
├─IndexScan_15 1.00 cop table:rr, index:aid, dic, range: decided by [dt.aid dt.dic], keep order:false
└─Selection_17 970.00 cop eq(rr.pt, "ios"), gt(rr.t, 1478185592)
Expand Down Expand Up @@ -226,6 +226,3 @@ HashAgg_34 18000.00 root group by:col_1, funcs:sum(col_0)
│ └─TableScan_58 2000.00 cop table:tbl_008, range:[-inf,+inf], keep order:false
└─TableReader_62 2000.00 root data:TableScan_61
└─TableScan_61 2000.00 cop table:tbl_009, range:[-inf,+inf], keep order:false



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_9 10.00 root index:IndexScan_8
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 @@ -123,10 +123,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.00 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
└─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.00 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
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_9 0.00 root index:IndexScan_8
└─IndexScan_8 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
└─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
└─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 @@ -110,10 +110,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
└─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
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
26 changes: 26 additions & 0 deletions cmd/explaintest/r/select.result
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,29 @@ desc select sysdate(), sleep(1), sysdate();
id count task operator info
Projection_3 1.00 root sysdate(), sleep(1), sysdate()
└─TableDual_4 1.00 root rows:1
drop table if exists th;
set @@session.tidb_enable_table_partition = '1';
create table th (a int, b int) partition by hash(a) partitions 3;
insert into th values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
insert into th values (-1,-1),(-2,-2),(-3,-3),(-4,-4),(-5,-5),(-6,-6),(-7,-7),(-8,-8);
desc select * from th where a=-2;
id count task operator info
TableReader_8 10.00 root data:Selection_7
└─Selection_7 10.00 cop eq(test.th.a, -2)
└─TableScan_6 10000.00 cop table:th, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo
desc select * from th;
id count task operator info
Union_8 30000.00 root
├─TableReader_10 10000.00 root data:TableScan_9
│ └─TableScan_9 10000.00 cop table:th, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_12 10000.00 root data:TableScan_11
│ └─TableScan_11 10000.00 cop table:th, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_14 10000.00 root data:TableScan_13
└─TableScan_13 10000.00 cop table:th, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo
desc select * from th partition (p2,p1);
id count task operator info
Union_7 20000.00 root
├─TableReader_9 10000.00 root data:TableScan_8
│ └─TableScan_8 10000.00 cop table:th, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop table:th, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo
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,17 +169,17 @@ LIMIT 0, 5;
id count task operator info
Projection_13 0.00 root te.expect_time
└─Limit_19 0.00 root offset:0, count:5
└─IndexJoin_137 0.00 root left outer join, inner:IndexReader_136, outer key:tr.id, inner key:p.relate_id
├─TopN_140 0.00 root te.expect_time:asc, offset:0, count:5
└─IndexJoin_138 0.00 root left outer join, inner:IndexReader_137, outer key:tr.id, inner key:p.relate_id
├─TopN_141 0.00 root te.expect_time:asc, offset:0, count:5
│ └─IndexJoin_35 0.00 root inner join, inner:IndexLookUp_34, outer key:tr.id, inner key:te.trade_id
│ ├─IndexLookUp_105 0.00 root
│ │ ├─Selection_103 0.00 cop eq(tr.business_type, 18), in(tr.trade_type, 1)
│ │ │ └─IndexScan_101 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_104 0.00 cop eq(tr.brand_identy, 32314), eq(tr.domain_type, 2)
│ │ └─TableScan_102 0.00 cop table:tr, keep order:false
│ ├─IndexLookUp_106 0.00 root
│ │ ├─Selection_104 0.00 cop eq(tr.business_type, 18), in(tr.trade_type, 1)
│ │ │ └─IndexScan_102 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_105 0.00 cop eq(tr.brand_identy, 32314), eq(tr.domain_type, 2)
│ │ └─TableScan_103 0.00 cop table:tr, keep order:false
│ └─IndexLookUp_34 250.00 root
│ ├─IndexScan_31 10.00 cop table:te, index:trade_id, range: decided by [tr.id], keep order:false, stats:pseudo
│ └─Selection_33 250.00 cop ge(te.expect_time, 2018-04-23 00:00:00.000000), le(te.expect_time, 2018-04-23 23:59:59.000000)
│ └─TableScan_32 10.00 cop table:te, keep order:false, stats:pseudo
└─IndexReader_136 10.00 root index:IndexScan_135
└─IndexScan_135 10.00 cop table:p, index:relate_id, range: decided by [tr.id], keep order:false, stats:pseudo
└─IndexReader_137 10.00 root index:IndexScan_136
└─IndexScan_136 10.00 cop table:p, index:relate_id, range: decided by [tr.id], keep order:false, stats:pseudo
Loading

0 comments on commit 85f4efe

Please sign in to comment.