Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

execution: refine precision of cast as decimal in agg func #30805

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bf4c7c7
refine precision of cast as decimal in agg func
dragonly Dec 16, 2021
a101ff5
fix for unsigned
dragonly Dec 16, 2021
4996c92
fix typo
dragonly Dec 16, 2021
f2dfa13
fix: only modify args decimal precision when function is sum
dragonly Dec 17, 2021
55c6523
fix plan test cases
dragonly Dec 17, 2021
0661403
fix plan test cases
dragonly Dec 17, 2021
cd0d33a
fix plan test cases
dragonly Dec 17, 2021
1c5f59d
fix explaintest
dragonly Dec 17, 2021
999fffa
fix explaintest
dragonly Dec 17, 2021
cebe292
fix explaintest & plan test cases
dragonly Dec 17, 2021
520647f
fix: accomodate float decimal
dragonly Dec 17, 2021
f2639b4
./run-tests.sh -r explain_easy
dragonly Dec 17, 2021
9581de0
fix ut
dragonly Dec 17, 2021
4ee8129
fix explain_complex
dragonly Dec 17, 2021
b1c2b1b
Apply suggestions from code review
dragonly Dec 17, 2021
f8f77da
Update expression/aggregation/base_func.go
dragonly Dec 20, 2021
b0f94ec
./run-tests.sh -r explain_complex_stats
dragonly Dec 20, 2021
eb60493
fix compile
dragonly Dec 20, 2021
471bd09
address reviewer's comments
dragonly Dec 20, 2021
19a80ad
improve code
dragonly Dec 20, 2021
69b4cad
improve comment
dragonly Dec 20, 2021
1cf8e97
add explaintest for sum & avg
dragonly Dec 20, 2021
bc9dca9
restore mysql.opt_rule_blacklist
dragonly Dec 20, 2021
ee5e055
./run-tests.sh -r explain_easy
dragonly Dec 20, 2021
9948be7
improve comment
dragonly Dec 21, 2021
7a7d943
Update expression/aggregation/base_func.go
dragonly Dec 22, 2021
d1cad1e
fix explaintest
dragonly Dec 22, 2021
55d3bdc
fix explaintest
dragonly Dec 22, 2021
7b538e0
fix all explaintest
dragonly Dec 22, 2021
459caec
fix ut
dragonly Dec 22, 2021
df374b1
refactor
dragonly Dec 22, 2021
cd8f8f8
Merge branch 'master' into dragonly/agg-cast-decimal-precision
hawkingrei Dec 23, 2021
9a5c03c
Merge branch 'master' into dragonly/agg-cast-decimal-precision
ti-chi-bot Dec 23, 2021
425a3dc
Merge branch 'master' into dragonly/agg-cast-decimal-precision
ti-chi-bot Dec 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/explaintest/r/explain_complex.result
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ CREATE TABLE `tbl_009` (`a` int, `b` int);
explain format = 'brief' select sum(a) from (select * from tbl_001 union all select * from tbl_002 union all select * from tbl_003 union all select * from tbl_004 union all select * from tbl_005 union all select * from tbl_006 union all select * from tbl_007 union all select * from tbl_008 union all select * from tbl_009) x group by b;
id estRows task access object operator info
HashAgg 72000.00 root group by:Column#32, funcs:sum(Column#31)->Column#30
└─Projection 90000.00 root cast(Column#28, decimal(32,0) BINARY)->Column#31, Column#29
└─Projection 90000.00 root cast(Column#28, decimal(10,0) BINARY)->Column#31, Column#29
└─Union 90000.00 root
├─TableReader 10000.00 root data:TableFullScan
│ └─TableFullScan 10000.00 cop[tikv] table:tbl_001 keep order:false, stats:pseudo
Expand Down
2 changes: 1 addition & 1 deletion cmd/explaintest/r/explain_complex_stats.result
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ load stats 's/explain_complex_stats_tbl_009.json';
explain format = 'brief' select sum(a) from (select * from tbl_001 union all select * from tbl_002 union all select * from tbl_003 union all select * from tbl_004 union all select * from tbl_005 union all select * from tbl_006 union all select * from tbl_007 union all select * from tbl_008 union all select * from tbl_009) x group by b;
id estRows task access object operator info
HashAgg 18000.00 root group by:Column#32, funcs:sum(Column#31)->Column#30
└─Projection 18000.00 root cast(Column#28, decimal(32,0) BINARY)->Column#31, Column#29
└─Projection 18000.00 root cast(Column#28, decimal(10,0) BINARY)->Column#31, Column#29
└─Union 18000.00 root
├─TableReader 2000.00 root data:TableFullScan
│ └─TableFullScan 2000.00 cop[tikv] table:tbl_001 keep order:false
Expand Down
128 changes: 123 additions & 5 deletions cmd/explaintest/r/explain_easy.result
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Selection 0.33 root gt(test.t1.c2, 1)
explain format = 'brief' select sum(t1.c1 in (select c1 from t2)) from t1;
id estRows task access object operator info
StreamAgg 1.00 root funcs:sum(Column#13)->Column#11
└─Projection 10000.00 root cast(Column#10, decimal(65,0) BINARY)->Column#13
└─Projection 10000.00 root cast(Column#10, decimal(3,0) BINARY)->Column#13
└─HashJoin 10000.00 root CARTESIAN left outer semi join, other cond:eq(test.t1.c1, test.t2.c1)
├─IndexReader(Build) 10000.00 root index:IndexFullScan
│ └─IndexFullScan 10000.00 cop[tikv] table:t2, index:c1(c1) keep order:false, stats:pseudo
Expand Down Expand Up @@ -225,7 +225,7 @@ set @@session.tidb_opt_insubq_to_join_and_agg=0;
explain format = 'brief' select sum(t1.c1 in (select c1 from t2)) from t1;
id estRows task access object operator info
StreamAgg 1.00 root funcs:sum(Column#13)->Column#11
└─Projection 10000.00 root cast(Column#10, decimal(65,0) BINARY)->Column#13
└─Projection 10000.00 root cast(Column#10, decimal(3,0) BINARY)->Column#13
└─HashJoin 10000.00 root CARTESIAN left outer semi join, other cond:eq(test.t1.c1, test.t2.c1)
├─IndexReader(Build) 10000.00 root index:IndexFullScan
│ └─IndexFullScan 10000.00 cop[tikv] table:t2, index:c1(c1) keep order:false, stats:pseudo
Expand All @@ -241,7 +241,7 @@ HashJoin 10000.00 root CARTESIAN left outer semi join, other cond:eq(1, test.t2
explain format = 'brief' select sum(6 in (select c2 from t2)) from t1;
id estRows task access object operator info
StreamAgg 1.00 root funcs:sum(Column#13)->Column#11
└─Projection 10000.00 root cast(Column#10, decimal(65,0) BINARY)->Column#13
└─Projection 10000.00 root cast(Column#10, decimal(3,0) BINARY)->Column#13
└─HashJoin 10000.00 root CARTESIAN left outer semi join, other cond:eq(6, test.t2.c2)
├─TableReader(Build) 10000.00 root data:TableFullScan
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
Expand Down Expand Up @@ -809,7 +809,7 @@ Projection 1.00 root Column#7
└─HashAgg(Probe) 1.00 root funcs:sum(Column#12)->Column#7
└─HashJoin 1.00 root CARTESIAN left outer join
├─HashAgg(Build) 1.00 root group by:1, funcs:sum(Column#14)->Column#12
│ └─Projection 1.00 root cast(Column#6, decimal(42,0) BINARY)->Column#14
│ └─Projection 1.00 root cast(Column#6, decimal(20,0) BINARY)->Column#14
│ └─MaxOneRow 1.00 root
│ └─Projection 1.00 root Column#5
│ └─TableDual 1.00 root rows:1
Expand All @@ -831,7 +831,7 @@ Projection 1.00 root Column#5
│ └─TableReader 10000.00 root data:TableFullScan
│ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
└─StreamAgg(Probe) 1.00 root funcs:sum(Column#7)->Column#5
└─Projection 1.00 root cast(Column#4, decimal(42,0) BINARY)->Column#7
└─Projection 1.00 root cast(Column#4, decimal(20,0) BINARY)->Column#7
└─TableDual 1.00 root rows:1
explain format = 'brief' select sum(a), (select sum(a)), count(a) from t group by b order by (select count(a));
id estRows task access object operator info
Expand All @@ -846,3 +846,121 @@ Projection 8000.00 root Column#4, Column#4, Column#5
└─HashAgg 8000.00 cop[tikv] group by:test.t.b, funcs:sum(test.t.a)->Column#13, funcs:count(test.t.a)->Column#14
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
drop table if exists t;
create table t(a tinyint, b smallint, c mediumint, d int, e bigint);
insert into mysql.opt_rule_blacklist VALUES("aggregation_push_down");
admin reload opt_rule_blacklist;

explain format = 'brief' select sum(t1.a) from t t1 join t t2 on t1.a=t2.a;
id estRows task access object operator info
StreamAgg 1.00 root funcs:sum(Column#14)->Column#13
└─Projection 12487.50 root cast(test.t.a, decimal(3,0) BINARY)->Column#14
└─HashJoin 12487.50 root inner join, equal:[eq(test.t.a, test.t.a)]
├─TableReader(Build) 9990.00 root data:Selection
│ └─Selection 9990.00 cop[tikv] not(isnull(test.t.a))
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 9990.00 root data:Selection
└─Selection 9990.00 cop[tikv] not(isnull(test.t.a))
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
explain format = 'brief' select sum(t1.b) from t t1 join t t2 on t1.b=t2.b;
id estRows task access object operator info
StreamAgg 1.00 root funcs:sum(Column#14)->Column#13
└─Projection 12487.50 root cast(test.t.b, decimal(5,0) BINARY)->Column#14
└─HashJoin 12487.50 root inner join, equal:[eq(test.t.b, test.t.b)]
├─TableReader(Build) 9990.00 root data:Selection
│ └─Selection 9990.00 cop[tikv] not(isnull(test.t.b))
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 9990.00 root data:Selection
└─Selection 9990.00 cop[tikv] not(isnull(test.t.b))
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
explain format = 'brief' select sum(t1.c) from t t1 join t t2 on t1.c=t2.c;
id estRows task access object operator info
StreamAgg 1.00 root funcs:sum(Column#14)->Column#13
└─Projection 12487.50 root cast(test.t.c, decimal(8,0) BINARY)->Column#14
└─HashJoin 12487.50 root inner join, equal:[eq(test.t.c, test.t.c)]
├─TableReader(Build) 9990.00 root data:Selection
│ └─Selection 9990.00 cop[tikv] not(isnull(test.t.c))
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 9990.00 root data:Selection
└─Selection 9990.00 cop[tikv] not(isnull(test.t.c))
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
explain format = 'brief' select sum(t1.d) from t t1 join t t2 on t1.d=t2.d;
id estRows task access object operator info
StreamAgg 1.00 root funcs:sum(Column#14)->Column#13
└─Projection 12487.50 root cast(test.t.d, decimal(10,0) BINARY)->Column#14
└─HashJoin 12487.50 root inner join, equal:[eq(test.t.d, test.t.d)]
├─TableReader(Build) 9990.00 root data:Selection
│ └─Selection 9990.00 cop[tikv] not(isnull(test.t.d))
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 9990.00 root data:Selection
└─Selection 9990.00 cop[tikv] not(isnull(test.t.d))
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
explain format = 'brief' select sum(t1.e) from t t1 join t t2 on t1.e=t2.e;
id estRows task access object operator info
StreamAgg 1.00 root funcs:sum(Column#14)->Column#13
└─Projection 12487.50 root cast(test.t.e, decimal(20,0) BINARY)->Column#14
└─HashJoin 12487.50 root inner join, equal:[eq(test.t.e, test.t.e)]
├─TableReader(Build) 9990.00 root data:Selection
│ └─Selection 9990.00 cop[tikv] not(isnull(test.t.e))
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 9990.00 root data:Selection
└─Selection 9990.00 cop[tikv] not(isnull(test.t.e))
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
explain format = 'brief' select avg(t1.a) from t t1 join t t2 on t1.a=t2.a;
id estRows task access object operator info
StreamAgg 1.00 root funcs:avg(Column#14)->Column#13
└─Projection 12487.50 root cast(test.t.a, decimal(8,4) BINARY)->Column#14
└─HashJoin 12487.50 root inner join, equal:[eq(test.t.a, test.t.a)]
├─TableReader(Build) 9990.00 root data:Selection
│ └─Selection 9990.00 cop[tikv] not(isnull(test.t.a))
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 9990.00 root data:Selection
└─Selection 9990.00 cop[tikv] not(isnull(test.t.a))
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
explain format = 'brief' select avg(t1.b) from t t1 join t t2 on t1.b=t2.b;
id estRows task access object operator info
StreamAgg 1.00 root funcs:avg(Column#14)->Column#13
└─Projection 12487.50 root cast(test.t.b, decimal(10,4) BINARY)->Column#14
└─HashJoin 12487.50 root inner join, equal:[eq(test.t.b, test.t.b)]
├─TableReader(Build) 9990.00 root data:Selection
│ └─Selection 9990.00 cop[tikv] not(isnull(test.t.b))
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 9990.00 root data:Selection
└─Selection 9990.00 cop[tikv] not(isnull(test.t.b))
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
explain format = 'brief' select avg(t1.c) from t t1 join t t2 on t1.c=t2.c;
id estRows task access object operator info
StreamAgg 1.00 root funcs:avg(Column#14)->Column#13
└─Projection 12487.50 root cast(test.t.c, decimal(13,4) BINARY)->Column#14
└─HashJoin 12487.50 root inner join, equal:[eq(test.t.c, test.t.c)]
├─TableReader(Build) 9990.00 root data:Selection
│ └─Selection 9990.00 cop[tikv] not(isnull(test.t.c))
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 9990.00 root data:Selection
└─Selection 9990.00 cop[tikv] not(isnull(test.t.c))
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
explain format = 'brief' select avg(t1.d) from t t1 join t t2 on t1.d=t2.d;
id estRows task access object operator info
StreamAgg 1.00 root funcs:avg(Column#14)->Column#13
└─Projection 12487.50 root cast(test.t.d, decimal(15,4) BINARY)->Column#14
└─HashJoin 12487.50 root inner join, equal:[eq(test.t.d, test.t.d)]
├─TableReader(Build) 9990.00 root data:Selection
│ └─Selection 9990.00 cop[tikv] not(isnull(test.t.d))
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 9990.00 root data:Selection
└─Selection 9990.00 cop[tikv] not(isnull(test.t.d))
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
explain format = 'brief' select avg(t1.e) from t t1 join t t2 on t1.e=t2.e;
id estRows task access object operator info
StreamAgg 1.00 root funcs:avg(Column#14)->Column#13
└─Projection 12487.50 root cast(test.t.e, decimal(24,4) BINARY)->Column#14
└─HashJoin 12487.50 root inner join, equal:[eq(test.t.e, test.t.e)]
├─TableReader(Build) 9990.00 root data:Selection
│ └─Selection 9990.00 cop[tikv] not(isnull(test.t.e))
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 9990.00 root data:Selection
└─Selection 9990.00 cop[tikv] not(isnull(test.t.e))
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
drop table if exists t;
delete from mysql.opt_rule_blacklist where name="aggregation_push_down";
admin reload opt_rule_blacklist;

8 changes: 4 additions & 4 deletions cmd/explaintest/r/generated_columns.result
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ INSERT INTO t1 (a) VALUES (2), (1), (1), (3), (NULL);
EXPLAIN format = 'brief' SELECT sum(a) FROM t1 GROUP BY b;
id estRows task access object operator info
HashAgg 8000.00 root group by:Column#7, funcs:sum(Column#6)->Column#5
└─Projection 10000.00 root cast(test.t1.a, decimal(32,0) BINARY)->Column#6, test.t1.b
└─Projection 10000.00 root cast(test.t1.a, decimal(10,0) BINARY)->Column#6, test.t1.b
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
EXPLAIN format = 'brief' SELECT sum(a) FROM t1 GROUP BY c;
Expand All @@ -194,13 +194,13 @@ HashAgg 8000.00 root group by:test.t1.c, funcs:sum(Column#6)->Column#5
EXPLAIN format = 'brief' SELECT sum(b) FROM t1 GROUP BY a;
id estRows task access object operator info
HashAgg 8000.00 root group by:Column#7, funcs:sum(Column#6)->Column#5
└─Projection 10000.00 root cast(test.t1.b, decimal(32,0) BINARY)->Column#6, test.t1.a
└─Projection 10000.00 root cast(test.t1.b, decimal(10,0) BINARY)->Column#6, test.t1.a
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
EXPLAIN format = 'brief' SELECT sum(b) FROM t1 GROUP BY c;
id estRows task access object operator info
HashAgg 8000.00 root group by:Column#9, funcs:sum(Column#8)->Column#5
└─Projection 10000.00 root cast(test.t1.b, decimal(32,0) BINARY)->Column#8, test.t1.c
└─Projection 10000.00 root cast(test.t1.b, decimal(10,0) BINARY)->Column#8, test.t1.c
└─Projection 10000.00 root test.t1.b, test.t1.c
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
Expand All @@ -213,7 +213,7 @@ HashAgg 8000.00 root group by:test.t1.a, funcs:sum(Column#6)->Column#5
EXPLAIN format = 'brief' SELECT sum(c) FROM t1 GROUP BY b;
id estRows task access object operator info
HashAgg 8000.00 root group by:Column#7, funcs:sum(Column#6)->Column#5
└─Projection 10000.00 root cast(test.t1.c, decimal(32,0) BINARY)->Column#6, test.t1.b
└─Projection 10000.00 root cast(test.t1.c, decimal(10,0) BINARY)->Column#6, test.t1.b
└─Projection 10000.00 root test.t1.b, test.t1.c
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
Expand Down
2 changes: 1 addition & 1 deletion cmd/explaintest/r/index_merge.result
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ explain select /*+ use_index_merge(t1) */ sum(c1) from t1 where (c1 < 10 or c2 <
id estRows task access object operator info
Sort_6 1473.49 root Column#5
└─HashAgg_11 1473.49 root group by:Column#10, funcs:sum(Column#9)->Column#5
└─Projection_18 1841.86 root cast(test.t1.c1, decimal(32,0) BINARY)->Column#9, test.t1.c1
└─Projection_18 1841.86 root cast(test.t1.c1, decimal(10,0) BINARY)->Column#9, test.t1.c1
└─IndexMerge_16 1841.86 root
├─IndexRangeScan_12(Build) 3323.33 cop[tikv] table:t1, index:c1(c1) range:[-inf,10), keep order:false, stats:pseudo
├─IndexRangeScan_13(Build) 3323.33 cop[tikv] table:t1, index:c2(c2) range:[-inf,10), keep order:false, stats:pseudo
Expand Down
4 changes: 2 additions & 2 deletions cmd/explaintest/r/select.result
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ id estRows task access object operator info
Projection 10000.00 root and(or(or(gt(Column#11, 1), ne(test.t.a, Column#10)), if(ne(Column#12, 0), <nil>, 0)), and(ne(Column#13, 0), if(isnull(test.t.a), <nil>, 1)))->Column#14
└─HashJoin 10000.00 root CARTESIAN inner join
├─StreamAgg(Build) 1.00 root funcs:max(Column#16)->Column#10, funcs:count(distinct Column#17)->Column#11, funcs:sum(Column#18)->Column#12, funcs:count(1)->Column#13
│ └─Projection 10000.00 root test.t.a, test.t.a, cast(isnull(test.t.a), decimal(22,0) BINARY)->Column#18
│ └─Projection 10000.00 root test.t.a, test.t.a, cast(isnull(test.t.a), decimal(20,0) BINARY)->Column#18
│ └─TableReader 10000.00 root data:TableFullScan
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 10000.00 root data:TableFullScan
Expand All @@ -395,7 +395,7 @@ id estRows task access object operator info
Projection 10000.00 root or(and(and(le(Column#11, 1), eq(test.t.a, Column#10)), if(ne(Column#12, 0), <nil>, 1)), or(eq(Column#13, 0), if(isnull(test.t.a), <nil>, 0)))->Column#14
└─HashJoin 10000.00 root CARTESIAN inner join
├─StreamAgg(Build) 1.00 root funcs:firstrow(Column#16)->Column#10, funcs:count(distinct Column#17)->Column#11, funcs:sum(Column#18)->Column#12, funcs:count(1)->Column#13
│ └─Projection 10000.00 root test.t.a, test.t.a, cast(isnull(test.t.a), decimal(22,0) BINARY)->Column#18
│ └─Projection 10000.00 root test.t.a, test.t.a, cast(isnull(test.t.a), decimal(20,0) BINARY)->Column#18
│ └─TableReader 10000.00 root data:TableFullScan
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
└─TableReader(Probe) 10000.00 root data:TableFullScan
Expand Down
2 changes: 1 addition & 1 deletion cmd/explaintest/r/tpch.result
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ id estRows task access object operator info
Sort 1.00 root tpch.lineitem.l_shipmode
└─Projection 1.00 root tpch.lineitem.l_shipmode, Column#27, Column#28
└─HashAgg 1.00 root group by:Column#40, funcs:sum(Column#37)->Column#27, funcs:sum(Column#38)->Column#28, funcs:firstrow(Column#39)->tpch.lineitem.l_shipmode
└─Projection 10023369.01 root cast(case(or(eq(tpch.orders.o_orderpriority, 1-URGENT), eq(tpch.orders.o_orderpriority, 2-HIGH)), 1, 0), decimal(22,0) BINARY)->Column#37, cast(case(and(ne(tpch.orders.o_orderpriority, 1-URGENT), ne(tpch.orders.o_orderpriority, 2-HIGH)), 1, 0), decimal(22,0) BINARY)->Column#38, tpch.lineitem.l_shipmode, tpch.lineitem.l_shipmode
└─Projection 10023369.01 root cast(case(or(eq(tpch.orders.o_orderpriority, 1-URGENT), eq(tpch.orders.o_orderpriority, 2-HIGH)), 1, 0), decimal(20,0) BINARY)->Column#37, cast(case(and(ne(tpch.orders.o_orderpriority, 1-URGENT), ne(tpch.orders.o_orderpriority, 2-HIGH)), 1, 0), decimal(20,0) BINARY)->Column#38, tpch.lineitem.l_shipmode, tpch.lineitem.l_shipmode
└─Projection 10023369.01 root tpch.orders.o_orderpriority, tpch.lineitem.l_shipmode
└─IndexJoin 10023369.01 root inner join, inner:TableReader, outer key:tpch.lineitem.l_orderkey, inner key:tpch.orders.o_orderkey, equal cond:eq(tpch.lineitem.l_orderkey, tpch.orders.o_orderkey)
├─TableReader(Build) 10023369.01 root data:Selection
Expand Down
Loading