Skip to content

Commit

Permalink
uupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
time-and-fate committed May 18, 2023
1 parent eef1add commit 92b9c98
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 167 deletions.
60 changes: 30 additions & 30 deletions cmd/explaintest/r/clustered_index.result
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,35 @@ id estRows task access object operator info
StreamAgg_17 1.00 root funcs:count(Column#8)->Column#6
└─IndexReader_18 1.00 root index:StreamAgg_9
└─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#8
└─IndexRangeScan_16 798.90 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,5429), keep order:false
└─IndexRangeScan_16 1920.90 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,5429), keep order:false
explain select count(*) from wout_cluster_index.tbl_0 where col_0 < 5429 ;
id estRows task access object operator info
StreamAgg_17 1.00 root funcs:count(Column#9)->Column#7
└─IndexReader_18 1.00 root index:StreamAgg_9
└─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#9
└─IndexRangeScan_16 798.90 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,5429), keep order:false
└─IndexRangeScan_16 1920.90 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,5429), keep order:false
explain select count(*) from with_cluster_index.tbl_0 where col_0 < 41 ;
id estRows task access object operator info
StreamAgg_17 1.00 root funcs:count(Column#8)->Column#6
└─IndexReader_18 1.00 root index:StreamAgg_9
└─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#8
└─IndexRangeScan_16 41.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,41), keep order:false
└─IndexRangeScan_16 1163.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,41), keep order:false
explain select count(*) from wout_cluster_index.tbl_0 where col_0 < 41 ;
id estRows task access object operator info
StreamAgg_17 1.00 root funcs:count(Column#9)->Column#7
└─IndexReader_18 1.00 root index:StreamAgg_9
└─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#9
└─IndexRangeScan_16 41.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,41), keep order:false
└─IndexRangeScan_16 1163.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,41), keep order:false
explain select col_14 from with_cluster_index.tbl_2 where col_11 <> '2013-11-01' ;
id estRows task access object operator info
Projection_4 4509.00 root with_cluster_index.tbl_2.col_14
└─IndexReader_6 4509.00 root index:IndexRangeScan_5
└─IndexRangeScan_5 4509.00 cop[tikv] table:tbl_2, index:idx_9(col_11) range:[-inf,2013-11-01 00:00:00), (2013-11-01 00:00:00,+inf], keep order:false
Projection_4 4673.00 root with_cluster_index.tbl_2.col_14
└─IndexReader_6 4673.00 root index:IndexRangeScan_5
└─IndexRangeScan_5 4673.00 cop[tikv] table:tbl_2, index:idx_9(col_11) range:[-inf,2013-11-01 00:00:00), (2013-11-01 00:00:00,+inf], keep order:false
explain select col_14 from wout_cluster_index.tbl_2 where col_11 <> '2013-11-01' ;
id estRows task access object operator info
Projection_4 4509.00 root wout_cluster_index.tbl_2.col_14
└─TableReader_7 4509.00 root data:Selection_6
└─Selection_6 4509.00 cop[tikv] ne(wout_cluster_index.tbl_2.col_11, 2013-11-01 00:00:00.000000)
Projection_4 4673.00 root wout_cluster_index.tbl_2.col_14
└─TableReader_7 4673.00 root data:Selection_6
└─Selection_6 4673.00 cop[tikv] ne(wout_cluster_index.tbl_2.col_11, 2013-11-01 00:00:00.000000)
└─TableFullScan_5 4673.00 cop[tikv] table:tbl_2 keep order:false
explain select sum( col_4 ) from with_cluster_index.tbl_0 where col_3 != '1993-12-02' ;
id estRows task access object operator info
Expand All @@ -76,57 +76,57 @@ StreamAgg_37 1.00 root funcs:sum(Column#20)->Column#7
└─TableFullScan_35 2244.00 cop[tikv] table:tbl_0 keep order:false
explain select col_0 from with_cluster_index.tbl_0 where col_0 <= 0 ;
id estRows task access object operator info
IndexReader_6 1.00 root index:IndexRangeScan_5
└─IndexRangeScan_5 1.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,0], keep order:false
IndexReader_6 1123.00 root index:IndexRangeScan_5
└─IndexRangeScan_5 1123.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,0], keep order:false
explain select col_0 from wout_cluster_index.tbl_0 where col_0 <= 0 ;
id estRows task access object operator info
IndexReader_6 1.00 root index:IndexRangeScan_5
└─IndexRangeScan_5 1.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,0], keep order:false
IndexReader_6 1123.00 root index:IndexRangeScan_5
└─IndexRangeScan_5 1123.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,0], keep order:false
explain select col_3 from with_cluster_index.tbl_0 where col_3 >= '1981-09-15' ;
id estRows task access object operator info
TableReader_6 1859.31 root data:TableRangeScan_5
└─TableRangeScan_5 1859.31 cop[tikv] table:tbl_0 range:[1981-09-15 00:00:00,+inf], keep order:false
TableReader_6 2244.00 root data:TableRangeScan_5
└─TableRangeScan_5 2244.00 cop[tikv] table:tbl_0 range:[1981-09-15 00:00:00,+inf], keep order:false
explain select col_3 from wout_cluster_index.tbl_0 where col_3 >= '1981-09-15' ;
id estRows task access object operator info
IndexReader_10 1859.31 root index:IndexRangeScan_9
└─IndexRangeScan_9 1859.31 cop[tikv] table:tbl_0, index:idx_2(col_3) range:[1981-09-15 00:00:00,+inf], keep order:false
IndexReader_10 2244.00 root index:IndexRangeScan_9
└─IndexRangeScan_9 2244.00 cop[tikv] table:tbl_0, index:idx_2(col_3) range:[1981-09-15 00:00:00,+inf], keep order:false
explain select tbl_2.col_14 , tbl_0.col_1 from with_cluster_index.tbl_2 right join with_cluster_index.tbl_0 on col_3 = col_11 ;
id estRows task access object operator info
MergeJoin_7 2533.51 root right outer join, left key:with_cluster_index.tbl_2.col_11, right key:with_cluster_index.tbl_0.col_3
├─IndexReader_22(Build) 4509.00 root index:IndexFullScan_21
│ └─IndexFullScan_21 4509.00 cop[tikv] table:tbl_2, index:idx_9(col_11) keep order:true
├─IndexReader_22(Build) 4673.00 root index:IndexFullScan_21
│ └─IndexFullScan_21 4673.00 cop[tikv] table:tbl_2, index:idx_9(col_11) keep order:true
└─TableReader_24(Probe) 2244.00 root data:TableFullScan_23
└─TableFullScan_23 2244.00 cop[tikv] table:tbl_0 keep order:true
explain select tbl_2.col_14 , tbl_0.col_1 from wout_cluster_index.tbl_2 right join wout_cluster_index.tbl_0 on col_3 = col_11 ;
id estRows task access object operator info
HashJoin_22 2533.51 root right outer join, equal:[eq(wout_cluster_index.tbl_2.col_11, wout_cluster_index.tbl_0.col_3)]
├─TableReader_41(Build) 2244.00 root data:TableFullScan_40
│ └─TableFullScan_40 2244.00 cop[tikv] table:tbl_0 keep order:false
└─TableReader_44(Probe) 4509.00 root data:Selection_43
└─Selection_43 4509.00 cop[tikv] not(isnull(wout_cluster_index.tbl_2.col_11))
└─TableReader_44(Probe) 4673.00 root data:Selection_43
└─Selection_43 4673.00 cop[tikv] not(isnull(wout_cluster_index.tbl_2.col_11))
└─TableFullScan_42 4673.00 cop[tikv] table:tbl_2 keep order:false
explain select count(*) from with_cluster_index.tbl_0 where col_0 <= 0 ;
id estRows task access object operator info
StreamAgg_16 1.00 root funcs:count(Column#8)->Column#6
└─IndexReader_17 1.00 root index:StreamAgg_9
StreamAgg_17 1.00 root funcs:count(Column#8)->Column#6
└─IndexReader_18 1.00 root index:StreamAgg_9
└─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#8
└─IndexRangeScan_11 1.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,0], keep order:false
└─IndexRangeScan_16 1123.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,0], keep order:false
explain select count(*) from wout_cluster_index.tbl_0 where col_0 <= 0 ;
id estRows task access object operator info
StreamAgg_16 1.00 root funcs:count(Column#9)->Column#7
└─IndexReader_17 1.00 root index:StreamAgg_9
StreamAgg_17 1.00 root funcs:count(Column#9)->Column#7
└─IndexReader_18 1.00 root index:StreamAgg_9
└─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#9
└─IndexRangeScan_11 1.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,0], keep order:false
└─IndexRangeScan_16 1123.00 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[-inf,0], keep order:false
explain select count(*) from with_cluster_index.tbl_0 where col_0 >= 803163 ;
id estRows task access object operator info
StreamAgg_17 1.00 root funcs:count(Column#8)->Column#6
└─IndexReader_18 1.00 root index:StreamAgg_9
└─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#8
└─IndexRangeScan_16 109.70 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[803163,+inf], keep order:false
└─IndexRangeScan_16 1231.70 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[803163,+inf], keep order:false
explain select count(*) from wout_cluster_index.tbl_0 where col_0 >= 803163 ;
id estRows task access object operator info
StreamAgg_17 1.00 root funcs:count(Column#9)->Column#7
└─IndexReader_18 1.00 root index:StreamAgg_9
└─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#9
└─IndexRangeScan_16 109.70 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[803163,+inf], keep order:false
└─IndexRangeScan_16 1231.70 cop[tikv] table:tbl_0, index:idx_3(col_0) range:[803163,+inf], keep order:false
set @@tidb_enable_outer_join_reorder=false;
35 changes: 17 additions & 18 deletions cmd/explaintest/r/explain_complex_stats.result
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,16 @@ Projection 21.47 root test.dt.ds, test.dt.p1, test.dt.p2, test.dt.p3, test.dt.p
└─TableRowIDScan 128.00 cop[tikv] table:dt keep order:false
explain format = 'brief' select gad.id as gid,sdk.id as sid,gad.aid as aid,gad.cm as cm,sdk.dic as dic,sdk.ip as ip, sdk.t as t, gad.p1 as p1, gad.p2 as p2, gad.p3 as p3, gad.p4 as p4, gad.p5 as p5, gad.p6_md5 as p6, gad.p7_md5 as p7, gad.ext as ext, gad.t as gtime from st gad join (select id, aid, pt, dic, ip, t from dd where pt = 'android' and bm = 0 and t > 1478143908) sdk on gad.aid = sdk.aid and gad.ip = sdk.ip and sdk.t > gad.t where gad.t > 1478143908 and gad.bm = 0 and gad.pt = 'android' group by gad.aid, sdk.dic limit 2500;
id estRows task access object operator info
Projection 424.00 root test.st.id, test.dd.id, test.st.aid, test.st.cm, test.dd.dic, test.dd.ip, test.dd.t, test.st.p1, test.st.p2, test.st.p3, test.st.p4, test.st.p5, test.st.p6_md5, test.st.p7_md5, test.st.ext, test.st.t
└─Limit 424.00 root offset:0, count:2500
└─HashAgg 424.00 root group by:test.dd.dic, test.st.aid, funcs:firstrow(test.st.id)->test.st.id, funcs:firstrow(test.st.aid)->test.st.aid, funcs:firstrow(test.st.cm)->test.st.cm, funcs:firstrow(test.st.p1)->test.st.p1, funcs:firstrow(test.st.p2)->test.st.p2, funcs:firstrow(test.st.p3)->test.st.p3, funcs:firstrow(test.st.p4)->test.st.p4, funcs:firstrow(test.st.p5)->test.st.p5, funcs:firstrow(test.st.p6_md5)->test.st.p6_md5, funcs:firstrow(test.st.p7_md5)->test.st.p7_md5, funcs:firstrow(test.st.ext)->test.st.ext, funcs:firstrow(test.st.t)->test.st.t, funcs:firstrow(test.dd.id)->test.dd.id, funcs:firstrow(test.dd.dic)->test.dd.dic, funcs:firstrow(test.dd.ip)->test.dd.ip, funcs:firstrow(test.dd.t)->test.dd.t
└─HashJoin 424.00 root inner join, equal:[eq(test.st.aid, test.dd.aid) eq(test.st.ip, test.dd.ip)], other cond:gt(test.dd.t, test.st.t)
├─TableReader(Build) 424.00 root data:Selection
│ └─Selection 424.00 cop[tikv] eq(test.st.bm, 0), eq(test.st.pt, "android"), gt(test.st.t, 1478143908), not(isnull(test.st.ip))
Projection 488.80 root test.st.id, test.dd.id, test.st.aid, test.st.cm, test.dd.dic, test.dd.ip, test.dd.t, test.st.p1, test.st.p2, test.st.p3, test.st.p4, test.st.p5, test.st.p6_md5, test.st.p7_md5, test.st.ext, test.st.t
└─Limit 488.80 root offset:0, count:2500
└─HashAgg 488.80 root group by:test.dd.dic, test.st.aid, funcs:firstrow(test.st.id)->test.st.id, funcs:firstrow(test.st.aid)->test.st.aid, funcs:firstrow(test.st.cm)->test.st.cm, funcs:firstrow(test.st.p1)->test.st.p1, funcs:firstrow(test.st.p2)->test.st.p2, funcs:firstrow(test.st.p3)->test.st.p3, funcs:firstrow(test.st.p4)->test.st.p4, funcs:firstrow(test.st.p5)->test.st.p5, funcs:firstrow(test.st.p6_md5)->test.st.p6_md5, funcs:firstrow(test.st.p7_md5)->test.st.p7_md5, funcs:firstrow(test.st.ext)->test.st.ext, funcs:firstrow(test.st.t)->test.st.t, funcs:firstrow(test.dd.id)->test.dd.id, funcs:firstrow(test.dd.dic)->test.dd.dic, funcs:firstrow(test.dd.ip)->test.dd.ip, funcs:firstrow(test.dd.t)->test.dd.t
└─HashJoin 488.80 root inner join, equal:[eq(test.st.aid, test.dd.aid) eq(test.st.ip, test.dd.ip)], other cond:gt(test.dd.t, test.st.t)
├─TableReader(Build) 488.80 root data:Selection
│ └─Selection 488.80 cop[tikv] eq(test.st.bm, 0), eq(test.st.pt, "android"), gt(test.st.t, 1478143908), not(isnull(test.st.ip))
│ └─TableFullScan 1999.00 cop[tikv] table:gad keep order:false
└─TableReader(Probe) 450.56 root data:Selection
└─Selection 450.56 cop[tikv] eq(test.dd.bm, 0), eq(test.dd.pt, "android"), gt(test.dd.t, 1478143908), not(isnull(test.dd.ip)), not(isnull(test.dd.t))
└─TableFullScan 2000.00 cop[tikv] table:dd keep order:false
└─TableReader(Probe) 501.17 root data:Selection
└─Selection 501.17 cop[tikv] eq(test.dd.bm, 0), eq(test.dd.pt, "android"), gt(test.dd.t, 1478143908), not(isnull(test.dd.ip)), not(isnull(test.dd.t))
└─TableFullScan 1994.00 cop[tikv] table:dd keep order:false
explain format = 'brief' select gad.id as gid,sdk.id as sid,gad.aid as aid,gad.cm as cm,sdk.dic as dic,sdk.ip as ip, sdk.t as t, gad.p1 as p1, gad.p2 as p2, gad.p3 as p3, gad.p4 as p4, gad.p5 as p5, gad.p6_md5 as p6, gad.p7_md5 as p7, gad.ext as ext from st gad join dd sdk on gad.aid = sdk.aid and gad.dic = sdk.mac and gad.t < sdk.t where gad.t > 1477971479 and gad.bm = 0 and gad.pt = 'ios' and gad.dit = 'mac' and sdk.t > 1477971479 and sdk.bm = 0 and sdk.pt = 'ios' limit 3000;
id estRows task access object operator info
Projection 170.34 root test.st.id, test.dd.id, test.st.aid, test.st.cm, test.dd.dic, test.dd.ip, test.dd.t, test.st.p1, test.st.p2, test.st.p3, test.st.p4, test.st.p5, test.st.p6_md5, test.st.p7_md5, test.st.ext
Expand All @@ -158,16 +158,15 @@ Projection 39.28 root test.st.cm, test.st.p1, test.st.p2, test.st.p3, test.st.p
└─TableRowIDScan 160.23 cop[tikv] table:st keep order:false
explain format = 'brief' select dt.id as id, dt.aid as aid, dt.pt as pt, dt.dic as dic, dt.cm as cm, rr.gid as gid, rr.acd as acd, rr.t as t,dt.p1 as p1, dt.p2 as p2, dt.p3 as p3, dt.p4 as p4, dt.p5 as p5, dt.p6_md5 as p6, dt.p7_md5 as p7 from dt dt join rr rr on (rr.pt = 'ios' and rr.t > 1478185592 and dt.aid = rr.aid and dt.dic = rr.dic) where dt.pt = 'ios' and dt.t > 1478185592 and dt.bm = 0 limit 2000;
id estRows task access object operator info
Projection 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 428.32 root offset:0, count:2000
└─IndexJoin 428.32 root inner join, inner:IndexLookUp, outer key:test.dt.aid, test.dt.dic, inner key:test.rr.aid, test.rr.dic, equal cond:eq(test.dt.aid, test.rr.aid), eq(test.dt.dic, test.rr.dic)
├─TableReader(Build) 428.32 root data:Selection
│ └─Selection 428.32 cop[tikv] eq(test.dt.bm, 0), eq(test.dt.pt, "ios"), gt(test.dt.t, 1478185592), not(isnull(test.dt.dic))
Projection 476.61 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 476.61 root offset:0, count:2000
└─HashJoin 476.61 root inner join, equal:[eq(test.dt.aid, test.rr.aid) eq(test.dt.dic, test.rr.dic)]
├─TableReader(Build) 476.61 root data:Selection
│ └─Selection 476.61 cop[tikv] eq(test.dt.bm, 0), eq(test.dt.pt, "ios"), gt(test.dt.t, 1478185592), not(isnull(test.dt.dic))
│ └─TableFullScan 2000.00 cop[tikv] table:dt keep order:false
└─IndexLookUp(Probe) 428.32 root
├─IndexRangeScan(Build) 428.32 cop[tikv] table:rr, index:PRIMARY(aid, dic) range: decided by [eq(test.rr.aid, test.dt.aid) eq(test.rr.dic, test.dt.dic)], keep order:false
└─Selection(Probe) 428.32 cop[tikv] eq(test.rr.pt, "ios"), gt(test.rr.t, 1478185592)
└─TableRowIDScan 428.32 cop[tikv] table:rr keep order:false
└─TableReader(Probe) 970.00 root data:Selection
└─Selection 970.00 cop[tikv] eq(test.rr.pt, "ios"), gt(test.rr.t, 1478185592)
└─TableFullScan 2000.00 cop[tikv] table:rr keep order:false
explain format = 'brief' select pc,cr,count(DISTINCT uid) as pay_users,count(oid) as pay_times,sum(am) as am from pp where ps=2 and ppt>=1478188800 and ppt<1478275200 and pi in ('510017','520017') and uid in ('18089709','18090780') group by pc,cr;
id estRows task access object operator info
Projection 207.02 root test.pp.pc, test.pp.cr, Column#22, Column#23, Column#24
Expand Down
6 changes: 3 additions & 3 deletions cmd/explaintest/r/explain_easy_stats.result
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ HashJoin 2481.25 root left outer join, equal:[eq(test.t1.c2, test.t2.c1)]
├─TableReader(Build) 1985.00 root data:Selection
│ └─Selection 1985.00 cop[tikv] not(isnull(test.t2.c1))
│ └─TableFullScan 1985.00 cop[tikv] table:t2 keep order:false
└─TableReader(Probe) 1998.00 root data:TableRangeScan
└─TableRangeScan 1998.00 cop[tikv] table:t1 range:(1,+inf], keep order:false
└─TableReader(Probe) 1999.00 root data:TableRangeScan
└─TableRangeScan 1999.00 cop[tikv] table:t1 range:(1,+inf], keep order:false
explain format = 'brief' update t1 set t1.c2 = 2 where t1.c1 = 1;
id estRows task access object operator info
Update N/A root N/A
Expand Down Expand Up @@ -88,7 +88,7 @@ IndexLookUp 0.00 root
└─TableRowIDScan 0.00 cop[tikv] table:t1 keep order:false
explain format = 'brief' select * from t1 where c1 = 1 and c2 > 1;
id estRows task access object operator info
Selection 0.50 root gt(test.t1.c2, 1)
Selection 1.00 root gt(test.t1.c2, 1)
└─Point_Get 1.00 root table:t1 handle:1
explain format = 'brief' select c1 from t1 where c1 in (select c2 from t2);
id estRows task access object operator info
Expand Down
Loading

0 comments on commit 92b9c98

Please sign in to comment.