planner,expression: fix wrong copy args to avoid breaking origin expression when to EvaluateExprWithNull (#61630)
close pingcap/tidb#60625
This commit is contained in:
@ -1829,11 +1829,11 @@ func TestMPP47766(t *testing.T) {
|
||||
"└─ExchangeSender_30 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection_5 8000.00 mpp[tiflash] date(test.traces.test_time)->Column#5, Column#4",
|
||||
" └─Projection_26 8000.00 mpp[tiflash] Column#4, test.traces.test_time",
|
||||
" └─HashAgg_27 8000.00 mpp[tiflash] group by:Column#14, funcs:sum(Column#15)->Column#4, funcs:firstrow(Column#16)->test.traces.test_time",
|
||||
" └─HashAgg_27 8000.00 mpp[tiflash] group by:Column#13, funcs:sum(Column#14)->Column#4, funcs:firstrow(Column#15)->test.traces.test_time",
|
||||
" └─ExchangeReceiver_29 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_28 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#14, collate: binary]",
|
||||
" └─HashAgg_25 8000.00 mpp[tiflash] group by:Column#18, funcs:count(1)->Column#15, funcs:firstrow(Column#17)->Column#16",
|
||||
" └─Projection_32 10000.00 mpp[tiflash] test.traces.test_time->Column#17, date(test.traces.test_time)->Column#18",
|
||||
" └─ExchangeSender_28 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#13, collate: binary]",
|
||||
" └─HashAgg_25 8000.00 mpp[tiflash] group by:Column#17, funcs:count(1)->Column#14, funcs:firstrow(Column#16)->Column#15",
|
||||
" └─Projection_32 10000.00 mpp[tiflash] test.traces.test_time->Column#16, date(test.traces.test_time)->Column#17",
|
||||
" └─TableFullScan_15 10000.00 mpp[tiflash] table:traces keep order:false, stats:pseudo",
|
||||
))
|
||||
}
|
||||
|
||||
@ -2525,7 +2525,7 @@ func BuildCastFunctionWithCheck(ctx BuildContext, expr Expression, tp *types.Fie
|
||||
// since we may reset the flag of the field type of CastAsJson later which
|
||||
// would affect the evaluation of it.
|
||||
if tp.EvalType() != types.ETJson && err == nil {
|
||||
res = FoldConstant(ctx, res)
|
||||
return FoldConstant(ctx, res), nil
|
||||
}
|
||||
return res, err
|
||||
}
|
||||
|
||||
@ -197,6 +197,7 @@ func (c *Constant) StringWithCtx(ctx ParamValues, redact string) string {
|
||||
// Clone implements Expression interface.
|
||||
func (c *Constant) Clone() Expression {
|
||||
con := *c
|
||||
con.RetType = c.RetType.Clone()
|
||||
if c.ParamMarker != nil {
|
||||
con.ParamMarker = &ParamMarker{order: c.ParamMarker.order}
|
||||
}
|
||||
|
||||
@ -186,10 +186,13 @@ func typeInferForNull(ctx EvalContext, args []Expression) {
|
||||
if !hasNullArg || retFieldTp == nil {
|
||||
return
|
||||
}
|
||||
for _, arg := range args {
|
||||
if isNull(arg) {
|
||||
*arg.GetType(ctx) = *retFieldTp
|
||||
arg.GetType(ctx).DelFlag(mysql.NotNullFlag) // Remove NotNullFlag of NullConst
|
||||
for i, arg := range args {
|
||||
argflags := arg.GetType(ctx)
|
||||
if isNull(arg) && !(argflags.Equals(retFieldTp) && mysql.HasNotNullFlag(retFieldTp.GetFlag())) {
|
||||
newarg := arg.Clone()
|
||||
*newarg.GetType(ctx) = *retFieldTp.Clone()
|
||||
newarg.GetType(ctx).DelFlag(mysql.NotNullFlag) // Remove NotNullFlag of NullConst
|
||||
args[i] = newarg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -344,8 +344,8 @@
|
||||
{
|
||||
"SQL": "EXPLAIN format = 'brief' SELECT count(a) from t group by md5(a); -- 10. scalar func not supported",
|
||||
"Plan": [
|
||||
"HashAgg 8000.00 root group by:Column#11, funcs:count(Column#10)->Column#6",
|
||||
"└─Projection 10000.00 root test.t.a->Column#10, md5(cast(test.t.a, var_string(20)))->Column#11",
|
||||
"HashAgg 8000.00 root group by:Column#10, funcs:count(Column#9)->Column#6",
|
||||
"└─Projection 10000.00 root test.t.a->Column#9, md5(cast(test.t.a, var_string(20)))->Column#10",
|
||||
" └─TableReader 10000.00 root MppVersion: 3, data:ExchangeSender",
|
||||
" └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
|
||||
@ -823,17 +823,17 @@
|
||||
"TableReader_56 8000.00 root MppVersion: 3, data:ExchangeSender_55",
|
||||
"└─ExchangeSender_55 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection_51 8000.00 mpp[tiflash] Column#7",
|
||||
" └─HashAgg_52 8000.00 mpp[tiflash] group by:Column#29, funcs:sum(Column#30)->Column#7",
|
||||
" └─HashAgg_52 8000.00 mpp[tiflash] group by:Column#28, funcs:sum(Column#29)->Column#7",
|
||||
" └─ExchangeReceiver_54 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_53 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#29, collate: binary]",
|
||||
" └─HashAgg_50 8000.00 mpp[tiflash] group by:Column#36, funcs:count(Column#35)->Column#30",
|
||||
" └─Projection_58 8000.00 mpp[tiflash] test.t.c->Column#35, plus(test.t.b, cast(test.t.d, bigint(10) BINARY))->Column#36",
|
||||
" └─ExchangeSender_53 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#28, collate: binary]",
|
||||
" └─HashAgg_50 8000.00 mpp[tiflash] group by:Column#35, funcs:count(Column#34)->Column#29",
|
||||
" └─Projection_58 8000.00 mpp[tiflash] test.t.c->Column#34, plus(test.t.b, cast(test.t.d, bigint(10) BINARY))->Column#35",
|
||||
" └─Projection_37 8000.00 mpp[tiflash] test.t.c, test.t.b, test.t.d",
|
||||
" └─HashAgg_38 8000.00 mpp[tiflash] group by:Column#21, test.t.c, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(Column#23)->test.t.b, funcs:firstrow(Column#24)->test.t.d",
|
||||
" └─HashAgg_38 8000.00 mpp[tiflash] group by:Column#20, test.t.c, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(Column#22)->test.t.b, funcs:firstrow(Column#23)->test.t.d",
|
||||
" └─ExchangeReceiver_40 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_39 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.c, collate: binary]",
|
||||
" └─HashAgg_36 8000.00 mpp[tiflash] group by:Column#33, Column#34, funcs:firstrow(Column#31)->Column#23, funcs:firstrow(Column#32)->Column#24",
|
||||
" └─Projection_57 10000.00 mpp[tiflash] test.t.b->Column#31, test.t.d->Column#32, plus(test.t.b, cast(test.t.d, bigint(10) BINARY))->Column#33, test.t.c->Column#34",
|
||||
" └─HashAgg_36 8000.00 mpp[tiflash] group by:Column#32, Column#33, funcs:firstrow(Column#30)->Column#22, funcs:firstrow(Column#31)->Column#23",
|
||||
" └─Projection_57 10000.00 mpp[tiflash] test.t.b->Column#30, test.t.d->Column#31, plus(test.t.b, cast(test.t.d, bigint(10) BINARY))->Column#32, test.t.c->Column#33",
|
||||
" └─TableFullScan_26 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
|
||||
],
|
||||
"Warn": null
|
||||
@ -844,17 +844,17 @@
|
||||
"TableReader_56 8000.00 root MppVersion: 3, data:ExchangeSender_55",
|
||||
"└─ExchangeSender_55 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection_51 8000.00 mpp[tiflash] Column#7",
|
||||
" └─HashAgg_52 8000.00 mpp[tiflash] group by:Column#44, Column#45, funcs:sum(Column#46)->Column#7",
|
||||
" └─HashAgg_52 8000.00 mpp[tiflash] group by:Column#42, Column#43, funcs:sum(Column#44)->Column#7",
|
||||
" └─ExchangeReceiver_54 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_53 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#44, collate: binary], [name: Column#45, collate: binary]",
|
||||
" └─HashAgg_50 8000.00 mpp[tiflash] group by:Column#55, Column#56, funcs:count(Column#54)->Column#46",
|
||||
" └─Projection_58 8000.00 mpp[tiflash] test.t.c->Column#54, plus(test.t.b, cast(test.t.d, bigint(10) BINARY))->Column#55, plus(test.t.a, test.t.b)->Column#56",
|
||||
" └─ExchangeSender_53 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#42, collate: binary], [name: Column#43, collate: binary]",
|
||||
" └─HashAgg_50 8000.00 mpp[tiflash] group by:Column#53, Column#54, funcs:count(Column#52)->Column#44",
|
||||
" └─Projection_58 8000.00 mpp[tiflash] test.t.c->Column#52, plus(test.t.b, cast(test.t.d, bigint(10) BINARY))->Column#53, plus(test.t.a, test.t.b)->Column#54",
|
||||
" └─Projection_37 8000.00 mpp[tiflash] test.t.c, test.t.b, test.t.d, test.t.a, test.t.b",
|
||||
" └─HashAgg_38 8000.00 mpp[tiflash] group by:Column#31, Column#32, test.t.c, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(Column#34)->test.t.b, funcs:firstrow(Column#35)->test.t.d, funcs:firstrow(Column#36)->test.t.a, funcs:firstrow(Column#37)->test.t.b",
|
||||
" └─HashAgg_38 8000.00 mpp[tiflash] group by:Column#29, Column#30, test.t.c, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(Column#32)->test.t.b, funcs:firstrow(Column#33)->test.t.d, funcs:firstrow(Column#34)->test.t.a, funcs:firstrow(Column#35)->test.t.b",
|
||||
" └─ExchangeReceiver_40 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_39 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.c, collate: binary]",
|
||||
" └─HashAgg_36 8000.00 mpp[tiflash] group by:Column#51, Column#52, Column#53, funcs:firstrow(Column#47)->Column#34, funcs:firstrow(Column#48)->Column#35, funcs:firstrow(Column#49)->Column#36, funcs:firstrow(Column#50)->Column#37",
|
||||
" └─Projection_57 10000.00 mpp[tiflash] test.t.b->Column#47, test.t.d->Column#48, test.t.a->Column#49, test.t.b->Column#50, plus(test.t.b, cast(test.t.d, bigint(10) BINARY))->Column#51, plus(test.t.a, test.t.b)->Column#52, test.t.c->Column#53",
|
||||
" └─HashAgg_36 8000.00 mpp[tiflash] group by:Column#49, Column#50, Column#51, funcs:firstrow(Column#45)->Column#32, funcs:firstrow(Column#46)->Column#33, funcs:firstrow(Column#47)->Column#34, funcs:firstrow(Column#48)->Column#35",
|
||||
" └─Projection_57 10000.00 mpp[tiflash] test.t.b->Column#45, test.t.d->Column#46, test.t.a->Column#47, test.t.b->Column#48, plus(test.t.b, cast(test.t.d, bigint(10) BINARY))->Column#49, plus(test.t.a, test.t.b)->Column#50, test.t.c->Column#51",
|
||||
" └─TableFullScan_26 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
|
||||
],
|
||||
"Warn": null
|
||||
@ -866,17 +866,17 @@
|
||||
"└─ExchangeSender_56 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection_8 8000.00 mpp[tiflash] Column#7, cast(Column#10, bigint(21) BINARY)->Column#8",
|
||||
" └─Projection_52 8000.00 mpp[tiflash] Column#7, Column#10",
|
||||
" └─HashAgg_53 8000.00 mpp[tiflash] group by:Column#34, funcs:sum(Column#35)->Column#7, funcs:sum(Column#36)->Column#10",
|
||||
" └─HashAgg_53 8000.00 mpp[tiflash] group by:Column#33, funcs:sum(Column#34)->Column#7, funcs:sum(Column#35)->Column#10",
|
||||
" └─ExchangeReceiver_55 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_54 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#34, collate: utf8mb4_bin]",
|
||||
" └─HashAgg_51 8000.00 mpp[tiflash] group by:Column#42, funcs:count(Column#40)->Column#35, funcs:sum(Column#41)->Column#36",
|
||||
" └─Projection_59 8000.00 mpp[tiflash] test.t.c->Column#40, cast(Column#9, decimal(20,0) BINARY)->Column#41, date_format(test.t.d, %Y)->Column#42",
|
||||
" └─ExchangeSender_54 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#33, collate: utf8mb4_bin]",
|
||||
" └─HashAgg_51 8000.00 mpp[tiflash] group by:Column#41, funcs:count(Column#39)->Column#34, funcs:sum(Column#40)->Column#35",
|
||||
" └─Projection_59 8000.00 mpp[tiflash] test.t.c->Column#39, cast(Column#9, decimal(20,0) BINARY)->Column#40, date_format(test.t.d, %Y)->Column#41",
|
||||
" └─Projection_38 8000.00 mpp[tiflash] test.t.c, Column#9, test.t.d",
|
||||
" └─HashAgg_39 8000.00 mpp[tiflash] group by:Column#24, test.t.c, funcs:firstrow(test.t.c)->test.t.c, funcs:sum(Column#26)->Column#9, funcs:firstrow(Column#27)->test.t.d",
|
||||
" └─HashAgg_39 8000.00 mpp[tiflash] group by:Column#23, test.t.c, funcs:firstrow(test.t.c)->test.t.c, funcs:sum(Column#25)->Column#9, funcs:firstrow(Column#26)->test.t.d",
|
||||
" └─ExchangeReceiver_41 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_40 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.c, collate: binary]",
|
||||
" └─HashAgg_37 8000.00 mpp[tiflash] group by:Column#38, Column#39, funcs:count(1)->Column#26, funcs:firstrow(Column#37)->Column#27",
|
||||
" └─Projection_58 10000.00 mpp[tiflash] test.t.d->Column#37, date_format(test.t.d, %Y)->Column#38, test.t.c->Column#39",
|
||||
" └─HashAgg_37 8000.00 mpp[tiflash] group by:Column#37, Column#38, funcs:count(1)->Column#25, funcs:firstrow(Column#36)->Column#26",
|
||||
" └─Projection_58 10000.00 mpp[tiflash] test.t.d->Column#36, date_format(test.t.d, %Y)->Column#37, test.t.c->Column#38",
|
||||
" └─TableFullScan_27 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
|
||||
],
|
||||
"Warn": null
|
||||
@ -888,17 +888,17 @@
|
||||
"└─ExchangeSender_56 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection_8 8000.00 mpp[tiflash] date_format(test.t.d, %Y)->Column#10, Column#7, cast(Column#14, bigint(21) BINARY)->Column#8, Column#9",
|
||||
" └─Projection_52 8000.00 mpp[tiflash] Column#7, Column#14, Column#9, test.t.d",
|
||||
" └─HashAgg_53 8000.00 mpp[tiflash] group by:Column#46, funcs:sum(Column#47)->Column#7, funcs:sum(Column#48)->Column#14, funcs:sum(Column#49)->Column#9, funcs:firstrow(Column#50)->test.t.d",
|
||||
" └─HashAgg_53 8000.00 mpp[tiflash] group by:Column#45, funcs:sum(Column#46)->Column#7, funcs:sum(Column#47)->Column#14, funcs:sum(Column#48)->Column#9, funcs:firstrow(Column#49)->test.t.d",
|
||||
" └─ExchangeReceiver_55 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_54 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#46, collate: utf8mb4_bin]",
|
||||
" └─HashAgg_51 8000.00 mpp[tiflash] group by:Column#60, funcs:sum(Column#56)->Column#47, funcs:sum(Column#57)->Column#48, funcs:count(Column#58)->Column#49, funcs:firstrow(Column#59)->Column#50",
|
||||
" └─Projection_59 8000.00 mpp[tiflash] Column#12->Column#56, cast(Column#13, decimal(20,0) BINARY)->Column#57, test.t.c->Column#58, test.t.d->Column#59, date_format(test.t.d, %Y)->Column#60",
|
||||
" └─ExchangeSender_54 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#45, collate: utf8mb4_bin]",
|
||||
" └─HashAgg_51 8000.00 mpp[tiflash] group by:Column#59, funcs:sum(Column#55)->Column#46, funcs:sum(Column#56)->Column#47, funcs:count(Column#57)->Column#48, funcs:firstrow(Column#58)->Column#49",
|
||||
" └─Projection_59 8000.00 mpp[tiflash] Column#12->Column#55, cast(Column#13, decimal(20,0) BINARY)->Column#56, test.t.c->Column#57, test.t.d->Column#58, date_format(test.t.d, %Y)->Column#59",
|
||||
" └─Projection_38 8000.00 mpp[tiflash] Column#12, Column#13, test.t.c, test.t.d",
|
||||
" └─HashAgg_39 8000.00 mpp[tiflash] group by:Column#31, test.t.c, funcs:sum(Column#32)->Column#12, funcs:sum(Column#33)->Column#13, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(Column#35)->test.t.d",
|
||||
" └─HashAgg_39 8000.00 mpp[tiflash] group by:Column#30, test.t.c, funcs:sum(Column#31)->Column#12, funcs:sum(Column#32)->Column#13, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(Column#34)->test.t.d",
|
||||
" └─ExchangeReceiver_41 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_40 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.c, collate: binary]",
|
||||
" └─HashAgg_37 8000.00 mpp[tiflash] group by:Column#54, Column#55, funcs:sum(Column#51)->Column#32, funcs:count(Column#52)->Column#33, funcs:firstrow(Column#53)->Column#35",
|
||||
" └─Projection_58 10000.00 mpp[tiflash] cast(test.t.a, decimal(10,0) BINARY)->Column#51, test.t.b->Column#52, test.t.d->Column#53, date_format(test.t.d, %Y)->Column#54, test.t.c->Column#55",
|
||||
" └─HashAgg_37 8000.00 mpp[tiflash] group by:Column#53, Column#54, funcs:sum(Column#50)->Column#31, funcs:count(Column#51)->Column#32, funcs:firstrow(Column#52)->Column#34",
|
||||
" └─Projection_58 10000.00 mpp[tiflash] cast(test.t.a, decimal(10,0) BINARY)->Column#50, test.t.b->Column#51, test.t.d->Column#52, date_format(test.t.d, %Y)->Column#53, test.t.c->Column#54",
|
||||
" └─TableFullScan_27 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
|
||||
],
|
||||
"Warn": null
|
||||
@ -932,17 +932,17 @@
|
||||
"└─ExchangeSender_55 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection_7 8000.00 mpp[tiflash] date_format(test.t.d, %Y)->Column#8, Column#7",
|
||||
" └─Projection_51 8000.00 mpp[tiflash] Column#7, test.t.d",
|
||||
" └─HashAgg_52 8000.00 mpp[tiflash] group by:Column#29, funcs:sum(Column#30)->Column#7, funcs:firstrow(Column#31)->test.t.d",
|
||||
" └─HashAgg_52 8000.00 mpp[tiflash] group by:Column#28, funcs:sum(Column#29)->Column#7, funcs:firstrow(Column#30)->test.t.d",
|
||||
" └─ExchangeReceiver_54 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_53 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#29, collate: utf8mb4_bin]",
|
||||
" └─HashAgg_50 8000.00 mpp[tiflash] group by:Column#37, funcs:count(Column#35)->Column#30, funcs:firstrow(Column#36)->Column#31",
|
||||
" └─Projection_58 8000.00 mpp[tiflash] test.t.c->Column#35, test.t.d->Column#36, date_format(test.t.d, %Y)->Column#37",
|
||||
" └─ExchangeSender_53 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#28, collate: utf8mb4_bin]",
|
||||
" └─HashAgg_50 8000.00 mpp[tiflash] group by:Column#36, funcs:count(Column#34)->Column#29, funcs:firstrow(Column#35)->Column#30",
|
||||
" └─Projection_58 8000.00 mpp[tiflash] test.t.c->Column#34, test.t.d->Column#35, date_format(test.t.d, %Y)->Column#36",
|
||||
" └─Projection_37 8000.00 mpp[tiflash] test.t.c, test.t.d",
|
||||
" └─HashAgg_38 8000.00 mpp[tiflash] group by:Column#20, test.t.c, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(Column#22)->test.t.d",
|
||||
" └─HashAgg_38 8000.00 mpp[tiflash] group by:Column#19, test.t.c, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(Column#21)->test.t.d",
|
||||
" └─ExchangeReceiver_40 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_39 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.c, collate: binary]",
|
||||
" └─HashAgg_36 8000.00 mpp[tiflash] group by:Column#33, Column#34, funcs:firstrow(Column#32)->Column#22",
|
||||
" └─Projection_57 10000.00 mpp[tiflash] test.t.d->Column#32, date_format(test.t.d, %Y)->Column#33, test.t.c->Column#34",
|
||||
" └─HashAgg_36 8000.00 mpp[tiflash] group by:Column#32, Column#33, funcs:firstrow(Column#31)->Column#21",
|
||||
" └─Projection_57 10000.00 mpp[tiflash] test.t.d->Column#31, date_format(test.t.d, %Y)->Column#32, test.t.c->Column#33",
|
||||
" └─TableFullScan_26 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
|
||||
],
|
||||
"Warn": null
|
||||
@ -954,17 +954,17 @@
|
||||
"└─ExchangeSender_56 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection_8 8000.00 mpp[tiflash] date_format(test.t.d, %Y)->Column#9, test.t.a, cast(Column#12, bigint(21) BINARY)->Column#7, Column#8",
|
||||
" └─Projection_52 8000.00 mpp[tiflash] Column#12, Column#8, test.t.a, test.t.d",
|
||||
" └─HashAgg_53 8000.00 mpp[tiflash] group by:Column#44, test.t.a, funcs:sum(Column#45)->Column#12, funcs:sum(Column#46)->Column#8, funcs:firstrow(test.t.a)->test.t.a, funcs:firstrow(Column#48)->test.t.d",
|
||||
" └─HashAgg_53 8000.00 mpp[tiflash] group by:Column#43, test.t.a, funcs:sum(Column#44)->Column#12, funcs:sum(Column#45)->Column#8, funcs:firstrow(test.t.a)->test.t.a, funcs:firstrow(Column#47)->test.t.d",
|
||||
" └─ExchangeReceiver_55 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_54 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.a, collate: binary]",
|
||||
" └─HashAgg_51 8000.00 mpp[tiflash] group by:Column#57, Column#58, funcs:sum(Column#54)->Column#45, funcs:count(Column#55)->Column#46, funcs:firstrow(Column#56)->Column#48",
|
||||
" └─Projection_59 8000.00 mpp[tiflash] cast(Column#11, decimal(20,0) BINARY)->Column#54, test.t.c->Column#55, test.t.d->Column#56, date_format(test.t.d, %Y)->Column#57, test.t.a->Column#58",
|
||||
" └─HashAgg_51 8000.00 mpp[tiflash] group by:Column#56, Column#57, funcs:sum(Column#53)->Column#44, funcs:count(Column#54)->Column#45, funcs:firstrow(Column#55)->Column#47",
|
||||
" └─Projection_59 8000.00 mpp[tiflash] cast(Column#11, decimal(20,0) BINARY)->Column#53, test.t.c->Column#54, test.t.d->Column#55, date_format(test.t.d, %Y)->Column#56, test.t.a->Column#57",
|
||||
" └─Projection_38 8000.00 mpp[tiflash] Column#11, test.t.c, test.t.a, test.t.d",
|
||||
" └─HashAgg_39 8000.00 mpp[tiflash] group by:Column#29, test.t.a, test.t.c, funcs:sum(Column#30)->Column#11, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(test.t.a)->test.t.a, funcs:firstrow(Column#33)->test.t.d",
|
||||
" └─HashAgg_39 8000.00 mpp[tiflash] group by:Column#28, test.t.a, test.t.c, funcs:sum(Column#29)->Column#11, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(test.t.a)->test.t.a, funcs:firstrow(Column#32)->test.t.d",
|
||||
" └─ExchangeReceiver_41 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_40 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.a, collate: binary], [name: test.t.c, collate: binary]",
|
||||
" └─HashAgg_37 8000.00 mpp[tiflash] group by:Column#51, Column#52, Column#53, funcs:count(Column#49)->Column#30, funcs:firstrow(Column#50)->Column#33",
|
||||
" └─Projection_58 10000.00 mpp[tiflash] test.t.b->Column#49, test.t.d->Column#50, date_format(test.t.d, %Y)->Column#51, test.t.a->Column#52, test.t.c->Column#53",
|
||||
" └─HashAgg_37 8000.00 mpp[tiflash] group by:Column#50, Column#51, Column#52, funcs:count(Column#48)->Column#29, funcs:firstrow(Column#49)->Column#32",
|
||||
" └─Projection_58 10000.00 mpp[tiflash] test.t.b->Column#48, test.t.d->Column#49, date_format(test.t.d, %Y)->Column#50, test.t.a->Column#51, test.t.c->Column#52",
|
||||
" └─TableFullScan_27 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
|
||||
],
|
||||
"Warn": null
|
||||
@ -975,18 +975,18 @@
|
||||
"TableReader_57 8000.00 root MppVersion: 3, data:ExchangeSender_56",
|
||||
"└─ExchangeSender_56 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection_8 8000.00 mpp[tiflash] date_format(test.t.d, %Y)->Column#9, test.t.a, cast(Column#12, bigint(21) BINARY)->Column#7, Column#8",
|
||||
" └─Projection_52 8000.00 mpp[tiflash] Column#12, div(Column#8, cast(case(eq(Column#47, 0), 1, Column#47), decimal(20,0) BINARY))->Column#8, test.t.a, test.t.d",
|
||||
" └─HashAgg_53 8000.00 mpp[tiflash] group by:Column#48, test.t.a, funcs:sum(Column#49)->Column#12, funcs:sum(Column#50)->Column#47, funcs:sum(Column#51)->Column#8, funcs:firstrow(test.t.a)->test.t.a, funcs:firstrow(Column#53)->test.t.d",
|
||||
" └─Projection_52 8000.00 mpp[tiflash] Column#12, div(Column#8, cast(case(eq(Column#46, 0), 1, Column#46), decimal(20,0) BINARY))->Column#8, test.t.a, test.t.d",
|
||||
" └─HashAgg_53 8000.00 mpp[tiflash] group by:Column#47, test.t.a, funcs:sum(Column#48)->Column#12, funcs:sum(Column#49)->Column#46, funcs:sum(Column#50)->Column#8, funcs:firstrow(test.t.a)->test.t.a, funcs:firstrow(Column#52)->test.t.d",
|
||||
" └─ExchangeReceiver_55 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_54 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.a, collate: binary]",
|
||||
" └─HashAgg_51 8000.00 mpp[tiflash] group by:Column#63, Column#64, funcs:sum(Column#59)->Column#49, funcs:count(Column#60)->Column#50, funcs:sum(Column#61)->Column#51, funcs:firstrow(Column#62)->Column#53",
|
||||
" └─Projection_59 8000.00 mpp[tiflash] cast(Column#11, decimal(20,0) BINARY)->Column#59, test.t.c->Column#60, cast(test.t.c, decimal(20,0) BINARY)->Column#61, test.t.d->Column#62, date_format(test.t.d, %Y)->Column#63, test.t.a->Column#64",
|
||||
" └─HashAgg_51 8000.00 mpp[tiflash] group by:Column#62, Column#63, funcs:sum(Column#58)->Column#48, funcs:count(Column#59)->Column#49, funcs:sum(Column#60)->Column#50, funcs:firstrow(Column#61)->Column#52",
|
||||
" └─Projection_59 8000.00 mpp[tiflash] cast(Column#11, decimal(20,0) BINARY)->Column#58, test.t.c->Column#59, cast(test.t.c, decimal(20,0) BINARY)->Column#60, test.t.d->Column#61, date_format(test.t.d, %Y)->Column#62, test.t.a->Column#63",
|
||||
" └─Projection_38 8000.00 mpp[tiflash] Column#11, test.t.c, test.t.a, test.t.d",
|
||||
" └─HashAgg_39 8000.00 mpp[tiflash] group by:Column#29, test.t.a, test.t.c, funcs:sum(Column#30)->Column#11, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(test.t.a)->test.t.a, funcs:firstrow(Column#33)->test.t.d",
|
||||
" └─HashAgg_39 8000.00 mpp[tiflash] group by:Column#28, test.t.a, test.t.c, funcs:sum(Column#29)->Column#11, funcs:firstrow(test.t.c)->test.t.c, funcs:firstrow(test.t.a)->test.t.a, funcs:firstrow(Column#32)->test.t.d",
|
||||
" └─ExchangeReceiver_41 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender_40 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.a, collate: binary], [name: test.t.c, collate: binary]",
|
||||
" └─HashAgg_37 8000.00 mpp[tiflash] group by:Column#56, Column#57, Column#58, funcs:count(Column#54)->Column#30, funcs:firstrow(Column#55)->Column#33",
|
||||
" └─Projection_58 10000.00 mpp[tiflash] test.t.b->Column#54, test.t.d->Column#55, date_format(test.t.d, %Y)->Column#56, test.t.a->Column#57, test.t.c->Column#58",
|
||||
" └─HashAgg_37 8000.00 mpp[tiflash] group by:Column#55, Column#56, Column#57, funcs:count(Column#53)->Column#29, funcs:firstrow(Column#54)->Column#32",
|
||||
" └─Projection_58 10000.00 mpp[tiflash] test.t.b->Column#53, test.t.d->Column#54, date_format(test.t.d, %Y)->Column#55, test.t.a->Column#56, test.t.c->Column#57",
|
||||
" └─TableFullScan_27 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
|
||||
],
|
||||
"Warn": null
|
||||
|
||||
@ -1966,11 +1966,11 @@
|
||||
"└─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection 8000.00 mpp[tiflash] Column#4, plus(test.t.id, 1)->Column#5",
|
||||
" └─Projection 8000.00 mpp[tiflash] Column#4, test.t.id",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#17, funcs:sum(Column#18)->Column#4, funcs:firstrow(Column#19)->test.t.id",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#16, funcs:sum(Column#17)->Column#4, funcs:firstrow(Column#18)->test.t.id",
|
||||
" └─ExchangeReceiver 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#17, collate: binary]",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#21, funcs:count(1)->Column#18, funcs:firstrow(Column#20)->Column#19",
|
||||
" └─Projection 10000.00 mpp[tiflash] test.t.id->Column#20, plus(test.t.id, 1)->Column#21",
|
||||
" └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#16, collate: binary]",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#20, funcs:count(1)->Column#17, funcs:firstrow(Column#19)->Column#18",
|
||||
" └─Projection 10000.00 mpp[tiflash] test.t.id->Column#19, plus(test.t.id, 1)->Column#20",
|
||||
" └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo"
|
||||
]
|
||||
},
|
||||
|
||||
@ -2746,11 +2746,11 @@
|
||||
"TableReader 8000.00 root MppVersion: 3, data:ExchangeSender",
|
||||
"└─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection 8000.00 mpp[tiflash] Column#5",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#13, funcs:sum(Column#14)->Column#5",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#12, funcs:sum(Column#13)->Column#5",
|
||||
" └─ExchangeReceiver 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#13, collate: binary]",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#15, funcs:count(1)->Column#14",
|
||||
" └─Projection 10000.00 mpp[tiflash] plus(test.employee.deptid, 1)->Column#15",
|
||||
" └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#12, collate: binary]",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#14, funcs:count(1)->Column#13",
|
||||
" └─Projection 10000.00 mpp[tiflash] plus(test.employee.deptid, 1)->Column#14",
|
||||
" └─TableFullScan 10000.00 mpp[tiflash] table:employee keep order:false, stats:pseudo"
|
||||
]
|
||||
},
|
||||
@ -2810,11 +2810,11 @@
|
||||
"TableReader 1.00 root MppVersion: 3, data:ExchangeSender",
|
||||
"└─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection 1.00 mpp[tiflash] Column#7",
|
||||
" └─HashAgg 1.00 mpp[tiflash] group by:Column#13, funcs:sum(Column#14)->Column#7",
|
||||
" └─HashAgg 1.00 mpp[tiflash] group by:Column#12, funcs:sum(Column#13)->Column#7",
|
||||
" └─ExchangeReceiver 1.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#13, collate: binary]",
|
||||
" └─HashAgg 1.00 mpp[tiflash] group by:Column#16, funcs:count(Column#15)->Column#14",
|
||||
" └─Projection 1.00 mpp[tiflash] Column#5->Column#15, plus(Column#6, 1)->Column#16",
|
||||
" └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#12, collate: binary]",
|
||||
" └─HashAgg 1.00 mpp[tiflash] group by:Column#15, funcs:count(Column#14)->Column#13",
|
||||
" └─Projection 1.00 mpp[tiflash] Column#5->Column#14, plus(Column#6, 1)->Column#15",
|
||||
" └─Projection 1.00 mpp[tiflash] Column#5, Column#6",
|
||||
" └─HashAgg 1.00 mpp[tiflash] funcs:count(distinct test.employee.deptid)->Column#5, funcs:count(distinct test.employee.empid)->Column#6",
|
||||
" └─ExchangeReceiver 1.00 mpp[tiflash] ",
|
||||
@ -2952,11 +2952,11 @@
|
||||
" │ └─Projection 6400.00 mpp[tiflash] plus(test.employee.deptid, 1)->Column#6, Column#5",
|
||||
" │ └─Selection 6400.00 mpp[tiflash] not(isnull(plus(test.employee.deptid, 1)))",
|
||||
" │ └─Projection 8000.00 mpp[tiflash] Column#5, test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#14, funcs:sum(Column#15)->Column#5, funcs:firstrow(Column#16)->test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#13, funcs:sum(Column#14)->Column#5, funcs:firstrow(Column#15)->test.employee.deptid",
|
||||
" │ └─ExchangeReceiver 8000.00 mpp[tiflash] ",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#14, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#28, funcs:count(Column#26)->Column#15, funcs:firstrow(Column#27)->Column#16",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#26, test.employee.deptid->Column#27, plus(test.employee.deptid, 1)->Column#28",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#13, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#27, funcs:count(Column#25)->Column#14, funcs:firstrow(Column#26)->Column#15",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#25, test.employee.deptid->Column#26, plus(test.employee.deptid, 1)->Column#27",
|
||||
" │ └─TableFullScan 10000.00 mpp[tiflash] table:employee keep order:false, stats:pseudo",
|
||||
" └─Selection(Probe) 9990.00 mpp[tiflash] not(isnull(test.employee.deptid))",
|
||||
" └─TableFullScan 10000.00 mpp[tiflash] table:e2 keep order:false, stats:pseudo"
|
||||
@ -2973,11 +2973,11 @@
|
||||
" │ └─Projection 6400.00 mpp[tiflash] plus(test.employee.deptid, 1)->Column#10, Column#9",
|
||||
" │ └─Selection 6400.00 mpp[tiflash] not(isnull(plus(test.employee.deptid, 1)))",
|
||||
" │ └─Projection 8000.00 mpp[tiflash] Column#9, test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#14, funcs:sum(Column#15)->Column#9, funcs:firstrow(Column#16)->test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#13, funcs:sum(Column#14)->Column#9, funcs:firstrow(Column#15)->test.employee.deptid",
|
||||
" │ └─ExchangeReceiver 8000.00 mpp[tiflash] ",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#14, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#28, funcs:count(Column#26)->Column#15, funcs:firstrow(Column#27)->Column#16",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#26, test.employee.deptid->Column#27, plus(test.employee.deptid, 1)->Column#28",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#13, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#27, funcs:count(Column#25)->Column#14, funcs:firstrow(Column#26)->Column#15",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#25, test.employee.deptid->Column#26, plus(test.employee.deptid, 1)->Column#27",
|
||||
" │ └─TableFullScan 10000.00 mpp[tiflash] table:employee keep order:false, stats:pseudo",
|
||||
" └─Selection(Probe) 9990.00 mpp[tiflash] not(isnull(test.employee.deptid))",
|
||||
" └─TableFullScan 10000.00 mpp[tiflash] table:e1 keep order:false, stats:pseudo"
|
||||
@ -2994,20 +2994,20 @@
|
||||
" │ └─Projection 6400.00 mpp[tiflash] plus(test.employee.deptid, 1)->Column#6, Column#5",
|
||||
" │ └─Selection 6400.00 mpp[tiflash] not(isnull(plus(test.employee.deptid, 1)))",
|
||||
" │ └─Projection 8000.00 mpp[tiflash] Column#5, test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#18, funcs:sum(Column#19)->Column#5, funcs:firstrow(Column#20)->test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#17, funcs:sum(Column#18)->Column#5, funcs:firstrow(Column#19)->test.employee.deptid",
|
||||
" │ └─ExchangeReceiver 8000.00 mpp[tiflash] ",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#18, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#45, funcs:count(Column#43)->Column#19, funcs:firstrow(Column#44)->Column#20",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#43, test.employee.deptid->Column#44, plus(test.employee.deptid, 1)->Column#45",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#17, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#43, funcs:count(Column#41)->Column#18, funcs:firstrow(Column#42)->Column#19",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#41, test.employee.deptid->Column#42, plus(test.employee.deptid, 1)->Column#43",
|
||||
" │ └─TableFullScan 10000.00 mpp[tiflash] table:employee keep order:false, stats:pseudo",
|
||||
" └─Projection(Probe) 6400.00 mpp[tiflash] plus(test.employee.deptid, 1)->Column#12, Column#11",
|
||||
" └─Selection 6400.00 mpp[tiflash] not(isnull(plus(test.employee.deptid, 1)))",
|
||||
" └─Projection 8000.00 mpp[tiflash] Column#11, test.employee.deptid",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#21, funcs:sum(Column#22)->Column#11, funcs:firstrow(Column#23)->test.employee.deptid",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#20, funcs:sum(Column#21)->Column#11, funcs:firstrow(Column#22)->test.employee.deptid",
|
||||
" └─ExchangeReceiver 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#21, collate: binary]",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#48, funcs:count(Column#46)->Column#22, funcs:firstrow(Column#47)->Column#23",
|
||||
" └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#46, test.employee.deptid->Column#47, plus(test.employee.deptid, 1)->Column#48",
|
||||
" └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#20, collate: binary]",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#46, funcs:count(Column#44)->Column#21, funcs:firstrow(Column#45)->Column#22",
|
||||
" └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#44, test.employee.deptid->Column#45, plus(test.employee.deptid, 1)->Column#46",
|
||||
" └─TableFullScan 10000.00 mpp[tiflash] table:employee keep order:false, stats:pseudo"
|
||||
]
|
||||
},
|
||||
@ -3091,22 +3091,22 @@
|
||||
"TableReader 8000.00 root MppVersion: 3, data:ExchangeSender",
|
||||
"└─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection 8000.00 mpp[tiflash] Column#6, Column#5, test.employee.empid, test.employee.deptid, test.employee.salary",
|
||||
" └─Projection 8000.00 mpp[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, Column#6, Column#5, Column#27",
|
||||
" └─Projection 8000.00 mpp[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, Column#6, Column#5, Column#26",
|
||||
" └─HashJoin 8000.00 mpp[tiflash] inner join, equal:[eq(test.employee.deptid, Column#6)]",
|
||||
" ├─ExchangeReceiver(Build) 6400.00 mpp[tiflash] ",
|
||||
" │ └─ExchangeSender 6400.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#6, collate: binary]",
|
||||
" │ └─Projection 6400.00 mpp[tiflash] plus(test.employee.deptid, 1)->Column#6, Column#5",
|
||||
" │ └─Selection 6400.00 mpp[tiflash] not(isnull(plus(test.employee.deptid, 1)))",
|
||||
" │ └─Projection 8000.00 mpp[tiflash] Column#5, test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#14, funcs:sum(Column#15)->Column#5, funcs:firstrow(Column#16)->test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#13, funcs:sum(Column#14)->Column#5, funcs:firstrow(Column#15)->test.employee.deptid",
|
||||
" │ └─ExchangeReceiver 8000.00 mpp[tiflash] ",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#14, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#30, funcs:count(Column#28)->Column#15, funcs:firstrow(Column#29)->Column#16",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#28, test.employee.deptid->Column#29, plus(test.employee.deptid, 1)->Column#30",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#13, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#29, funcs:count(Column#27)->Column#14, funcs:firstrow(Column#28)->Column#15",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#27, test.employee.deptid->Column#28, plus(test.employee.deptid, 1)->Column#29",
|
||||
" │ └─TableFullScan 10000.00 mpp[tiflash] table:employee keep order:false, stats:pseudo",
|
||||
" └─ExchangeReceiver(Probe) 9990.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#27, collate: binary]",
|
||||
" └─Projection 9990.00 mpp[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, cast(test.employee.deptid, bigint(20))->Column#27",
|
||||
" └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#26, collate: binary]",
|
||||
" └─Projection 9990.00 mpp[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, cast(test.employee.deptid, bigint(20))->Column#26",
|
||||
" └─Selection 9990.00 mpp[tiflash] not(isnull(test.employee.deptid))",
|
||||
" └─TableFullScan 10000.00 mpp[tiflash] table:e2 keep order:false, stats:pseudo"
|
||||
]
|
||||
@ -3117,22 +3117,22 @@
|
||||
"TableReader 8000.00 root MppVersion: 3, data:ExchangeSender",
|
||||
"└─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection 8000.00 mpp[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, Column#10, Column#9",
|
||||
" └─Projection 8000.00 mpp[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, Column#10, Column#9, Column#27",
|
||||
" └─Projection 8000.00 mpp[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, Column#10, Column#9, Column#26",
|
||||
" └─HashJoin 8000.00 mpp[tiflash] inner join, equal:[eq(test.employee.deptid, Column#10)]",
|
||||
" ├─ExchangeReceiver(Build) 6400.00 mpp[tiflash] ",
|
||||
" │ └─ExchangeSender 6400.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#10, collate: binary]",
|
||||
" │ └─Projection 6400.00 mpp[tiflash] plus(test.employee.deptid, 1)->Column#10, Column#9",
|
||||
" │ └─Selection 6400.00 mpp[tiflash] not(isnull(plus(test.employee.deptid, 1)))",
|
||||
" │ └─Projection 8000.00 mpp[tiflash] Column#9, test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#14, funcs:sum(Column#15)->Column#9, funcs:firstrow(Column#16)->test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#13, funcs:sum(Column#14)->Column#9, funcs:firstrow(Column#15)->test.employee.deptid",
|
||||
" │ └─ExchangeReceiver 8000.00 mpp[tiflash] ",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#14, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#30, funcs:count(Column#28)->Column#15, funcs:firstrow(Column#29)->Column#16",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#28, test.employee.deptid->Column#29, plus(test.employee.deptid, 1)->Column#30",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#13, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#29, funcs:count(Column#27)->Column#14, funcs:firstrow(Column#28)->Column#15",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#27, test.employee.deptid->Column#28, plus(test.employee.deptid, 1)->Column#29",
|
||||
" │ └─TableFullScan 10000.00 mpp[tiflash] table:employee keep order:false, stats:pseudo",
|
||||
" └─ExchangeReceiver(Probe) 9990.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#27, collate: binary]",
|
||||
" └─Projection 9990.00 mpp[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, cast(test.employee.deptid, bigint(20))->Column#27",
|
||||
" └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#26, collate: binary]",
|
||||
" └─Projection 9990.00 mpp[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, cast(test.employee.deptid, bigint(20))->Column#26",
|
||||
" └─Selection 9990.00 mpp[tiflash] not(isnull(test.employee.deptid))",
|
||||
" └─TableFullScan 10000.00 mpp[tiflash] table:e1 keep order:false, stats:pseudo"
|
||||
]
|
||||
@ -3148,22 +3148,22 @@
|
||||
" │ └─Projection 6400.00 mpp[tiflash] plus(test.employee.deptid, 1)->Column#6, Column#5",
|
||||
" │ └─Selection 6400.00 mpp[tiflash] not(isnull(plus(test.employee.deptid, 1)))",
|
||||
" │ └─Projection 8000.00 mpp[tiflash] Column#5, test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#18, funcs:sum(Column#19)->Column#5, funcs:firstrow(Column#20)->test.employee.deptid",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#17, funcs:sum(Column#18)->Column#5, funcs:firstrow(Column#19)->test.employee.deptid",
|
||||
" │ └─ExchangeReceiver 8000.00 mpp[tiflash] ",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#18, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#45, funcs:count(Column#43)->Column#19, funcs:firstrow(Column#44)->Column#20",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#43, test.employee.deptid->Column#44, plus(test.employee.deptid, 1)->Column#45",
|
||||
" │ └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#17, collate: binary]",
|
||||
" │ └─HashAgg 8000.00 mpp[tiflash] group by:Column#43, funcs:count(Column#41)->Column#18, funcs:firstrow(Column#42)->Column#19",
|
||||
" │ └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#41, test.employee.deptid->Column#42, plus(test.employee.deptid, 1)->Column#43",
|
||||
" │ └─TableFullScan 10000.00 mpp[tiflash] table:employee keep order:false, stats:pseudo",
|
||||
" └─ExchangeReceiver(Probe) 6400.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender 6400.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#12, collate: binary]",
|
||||
" └─Projection 6400.00 mpp[tiflash] plus(test.employee.deptid, 1)->Column#12, Column#11",
|
||||
" └─Selection 6400.00 mpp[tiflash] not(isnull(plus(test.employee.deptid, 1)))",
|
||||
" └─Projection 8000.00 mpp[tiflash] Column#11, test.employee.deptid",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#22, funcs:sum(Column#23)->Column#11, funcs:firstrow(Column#24)->test.employee.deptid",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#20, funcs:sum(Column#21)->Column#11, funcs:firstrow(Column#22)->test.employee.deptid",
|
||||
" └─ExchangeReceiver 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#22, collate: binary]",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#48, funcs:count(Column#46)->Column#23, funcs:firstrow(Column#47)->Column#24",
|
||||
" └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#46, test.employee.deptid->Column#47, plus(test.employee.deptid, 1)->Column#48",
|
||||
" └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#20, collate: binary]",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#46, funcs:count(Column#44)->Column#21, funcs:firstrow(Column#45)->Column#22",
|
||||
" └─Projection 10000.00 mpp[tiflash] test.employee.empid->Column#44, test.employee.deptid->Column#45, plus(test.employee.deptid, 1)->Column#46",
|
||||
" └─TableFullScan 10000.00 mpp[tiflash] table:employee keep order:false, stats:pseudo"
|
||||
]
|
||||
}
|
||||
|
||||
@ -298,8 +298,8 @@
|
||||
"Plan": [
|
||||
"Projection 6393.60 root Column#21, minus(test.t2.b2, 5)->Column#22",
|
||||
"└─Selection 6393.60 root gt(minus(test.t2.b2, 5), 1)",
|
||||
" └─HashAgg 7992.00 root group by:Column#27, funcs:count(Column#25)->Column#21, funcs:firstrow(Column#26)->test.t2.b2",
|
||||
" └─Projection 12487.50 root test.t2.a2->Column#25, test.t2.b2->Column#26, minus(test.t2.b2, 5)->Column#27",
|
||||
" └─HashAgg 7992.00 root group by:Column#26, funcs:count(Column#24)->Column#21, funcs:firstrow(Column#25)->test.t2.b2",
|
||||
" └─Projection 12487.50 root test.t2.a2->Column#24, test.t2.b2->Column#25, minus(test.t2.b2, 5)->Column#26",
|
||||
" └─HashJoin 12487.50 root inner join, equal:[eq(test.t1.a1, test.t2.a2)]",
|
||||
" ├─TableReader(Build) 9990.00 root data:Selection",
|
||||
" │ └─Selection 9990.00 cop[tikv] not(isnull(test.t1.a1))",
|
||||
|
||||
@ -260,11 +260,11 @@
|
||||
" └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: PassThrough",
|
||||
" └─Projection 8000.00 mpp[tiflash] test.nation.n_name, Column#52, Column#54",
|
||||
" └─Projection 8000.00 mpp[tiflash] Column#54, test.nation.n_name, Column#52",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#67, test.nation.n_name, funcs:sum(Column#68)->Column#54, funcs:firstrow(test.nation.n_name)->test.nation.n_name, funcs:firstrow(Column#67)->Column#52",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#66, test.nation.n_name, funcs:sum(Column#67)->Column#54, funcs:firstrow(test.nation.n_name)->test.nation.n_name, funcs:firstrow(Column#66)->Column#52",
|
||||
" └─ExchangeReceiver 8000.00 mpp[tiflash] ",
|
||||
" └─ExchangeSender 8000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.nation.n_name, collate: utf8mb4_bin]",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#72, Column#73, funcs:sum(Column#71)->Column#68",
|
||||
" └─Projection 24414.06 mpp[tiflash] minus(mul(test.lineitem.l_extendedprice, minus(1, test.lineitem.l_discount)), mul(test.partsupp.ps_supplycost, test.lineitem.l_quantity))->Column#71, test.nation.n_name->Column#72, extract(YEAR, test.orders.o_orderdate)->Column#73",
|
||||
" └─HashAgg 8000.00 mpp[tiflash] group by:Column#71, Column#72, funcs:sum(Column#70)->Column#67",
|
||||
" └─Projection 24414.06 mpp[tiflash] minus(mul(test.lineitem.l_extendedprice, minus(1, test.lineitem.l_discount)), mul(test.partsupp.ps_supplycost, test.lineitem.l_quantity))->Column#70, test.nation.n_name->Column#71, extract(YEAR, test.orders.o_orderdate)->Column#72",
|
||||
" └─Projection 24414.06 mpp[tiflash] test.lineitem.l_quantity, test.lineitem.l_extendedprice, test.lineitem.l_discount, test.partsupp.ps_supplycost, test.orders.o_orderdate, test.nation.n_name",
|
||||
" └─Projection 24414.06 mpp[tiflash] test.lineitem.l_quantity, test.lineitem.l_extendedprice, test.lineitem.l_discount, test.partsupp.ps_supplycost, test.orders.o_orderdate, test.nation.n_name, test.supplier.s_nationkey",
|
||||
" └─HashJoin 24414.06 mpp[tiflash] inner join, equal:[eq(test.supplier.s_nationkey, test.nation.n_nationkey)]",
|
||||
@ -422,8 +422,8 @@
|
||||
"Result": [
|
||||
"Sort_60 4096.00 4544722.62 (((((cpu(10*3*tidb_cpu_factor(49.9))) + (((cpu(10*3*tidb_cpu_factor(49.9))) + ((cpu(8000*filters(1)*tidb_cpu_factor(49.9))) + ((((((cpu(10000*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))))*1.00))) + (net(8000*rowsize(87)*tidb_flash_net_factor(2.2))))/15.00)*1.00)) + (((((((scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))))*1.00)) + (net(10000*rowsize(16)*tidb_flash_net_factor(2.2))))/15.00)*1.00) + ((hashkey(6400*1*tidb_cpu_factor(49.9))) + (hashmem(6400*87*tidb_mem_factor(0.2))) + (hashbuild(6400*tidb_cpu_factor(49.9)))) + (cpu(6400*filters(0)*tidb_cpu_factor(49.9))) + (((cpu(10000*filters(0)*tidb_cpu_factor(49.9))) + ((hashkey(10000*1*tidb_cpu_factor(49.9))) + (hashprobe(10000*tidb_cpu_factor(49.9)))))/5.00))*1.00) + (((agg(5120*aggs(3)*tidb_cpu_factor(49.9))) + (group(5120*cols(1)*tidb_cpu_factor(49.9))) + ((hashkey(4096*1*tidb_cpu_factor(49.9))) + (hashmem(4096*63*tidb_mem_factor(0.2))) + (hashbuild(4096*tidb_cpu_factor(49.9)))) + ((hashkey(5120*1*tidb_cpu_factor(49.9))) + (hashprobe(5120*tidb_cpu_factor(49.9)))))/5.00))*1.00) + ((cpu(4096*filters(0.03)*tidb_cpu_factor(49.9)))/5.00)) + ((exprCPU(4096*0*tidb_cpu_factor(49.9))) + (orderCPU(4096*log(4096)*tidb_cpu_factor(49.9)))) + (sortMem(4096*63*tidb_mem_factor(0.2))))*1.00 root Column#36",
|
||||
"└─Projection_62 4096.00 2040428.22 (((cpu(10*3*tidb_cpu_factor(49.9))) + (((cpu(10*3*tidb_cpu_factor(49.9))) + ((cpu(8000*filters(1)*tidb_cpu_factor(49.9))) + ((((((cpu(10000*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))))*1.00))) + (net(8000*rowsize(87)*tidb_flash_net_factor(2.2))))/15.00)*1.00)) + (((((((scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))))*1.00)) + (net(10000*rowsize(16)*tidb_flash_net_factor(2.2))))/15.00)*1.00) + ((hashkey(6400*1*tidb_cpu_factor(49.9))) + (hashmem(6400*87*tidb_mem_factor(0.2))) + (hashbuild(6400*tidb_cpu_factor(49.9)))) + (cpu(6400*filters(0)*tidb_cpu_factor(49.9))) + (((cpu(10000*filters(0)*tidb_cpu_factor(49.9))) + ((hashkey(10000*1*tidb_cpu_factor(49.9))) + (hashprobe(10000*tidb_cpu_factor(49.9)))))/5.00))*1.00) + (((agg(5120*aggs(3)*tidb_cpu_factor(49.9))) + (group(5120*cols(1)*tidb_cpu_factor(49.9))) + ((hashkey(4096*1*tidb_cpu_factor(49.9))) + (hashmem(4096*63*tidb_mem_factor(0.2))) + (hashbuild(4096*tidb_cpu_factor(49.9)))) + ((hashkey(5120*1*tidb_cpu_factor(49.9))) + (hashprobe(5120*tidb_cpu_factor(49.9)))))/5.00))*1.00) + ((cpu(4096*filters(0.03)*tidb_cpu_factor(49.9)))/5.00) root Column#36, Column#37, Column#38",
|
||||
" └─HashAgg_66 4096.00 2039201.87 ((cpu(10*3*tidb_cpu_factor(49.9))) + (((cpu(10*3*tidb_cpu_factor(49.9))) + ((cpu(8000*filters(1)*tidb_cpu_factor(49.9))) + ((((((cpu(10000*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))))*1.00))) + (net(8000*rowsize(87)*tidb_flash_net_factor(2.2))))/15.00)*1.00)) + (((((((scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))))*1.00)) + (net(10000*rowsize(16)*tidb_flash_net_factor(2.2))))/15.00)*1.00) + ((hashkey(6400*1*tidb_cpu_factor(49.9))) + (hashmem(6400*87*tidb_mem_factor(0.2))) + (hashbuild(6400*tidb_cpu_factor(49.9)))) + (cpu(6400*filters(0)*tidb_cpu_factor(49.9))) + (((cpu(10000*filters(0)*tidb_cpu_factor(49.9))) + ((hashkey(10000*1*tidb_cpu_factor(49.9))) + (hashprobe(10000*tidb_cpu_factor(49.9)))))/5.00))*1.00) + (((agg(5120*aggs(3)*tidb_cpu_factor(49.9))) + (group(5120*cols(1)*tidb_cpu_factor(49.9))) + ((hashkey(4096*1*tidb_cpu_factor(49.9))) + (hashmem(4096*63*tidb_mem_factor(0.2))) + (hashbuild(4096*tidb_cpu_factor(49.9)))) + ((hashkey(5120*1*tidb_cpu_factor(49.9))) + (hashprobe(5120*tidb_cpu_factor(49.9)))))/5.00))*1.00 root group by:Column#42, funcs:count(1)->Column#37, funcs:sum(Column#41)->Column#38, funcs:firstrow(Column#42)->Column#36",
|
||||
" └─Projection_103 5120.00 1690649.77 (((cpu(10*3*tidb_cpu_factor(49.9))) + ((cpu(8000*filters(1)*tidb_cpu_factor(49.9))) + ((((((cpu(10000*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))))*1.00))) + (net(8000*rowsize(87)*tidb_flash_net_factor(2.2))))/15.00)*1.00)) + (((((((scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))))*1.00)) + (net(10000*rowsize(16)*tidb_flash_net_factor(2.2))))/15.00)*1.00) + ((hashkey(6400*1*tidb_cpu_factor(49.9))) + (hashmem(6400*87*tidb_mem_factor(0.2))) + (hashbuild(6400*tidb_cpu_factor(49.9)))) + (cpu(6400*filters(0)*tidb_cpu_factor(49.9))) + (((cpu(10000*filters(0)*tidb_cpu_factor(49.9))) + ((hashkey(10000*1*tidb_cpu_factor(49.9))) + (hashprobe(10000*tidb_cpu_factor(49.9)))))/5.00))*1.00) root test.customer.c_acctbal->Column#41, substring(test.customer.c_phone, 1, 2)->Column#42",
|
||||
" └─HashAgg_66 4096.00 2039201.87 ((cpu(10*3*tidb_cpu_factor(49.9))) + (((cpu(10*3*tidb_cpu_factor(49.9))) + ((cpu(8000*filters(1)*tidb_cpu_factor(49.9))) + ((((((cpu(10000*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))))*1.00))) + (net(8000*rowsize(87)*tidb_flash_net_factor(2.2))))/15.00)*1.00)) + (((((((scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))))*1.00)) + (net(10000*rowsize(16)*tidb_flash_net_factor(2.2))))/15.00)*1.00) + ((hashkey(6400*1*tidb_cpu_factor(49.9))) + (hashmem(6400*87*tidb_mem_factor(0.2))) + (hashbuild(6400*tidb_cpu_factor(49.9)))) + (cpu(6400*filters(0)*tidb_cpu_factor(49.9))) + (((cpu(10000*filters(0)*tidb_cpu_factor(49.9))) + ((hashkey(10000*1*tidb_cpu_factor(49.9))) + (hashprobe(10000*tidb_cpu_factor(49.9)))))/5.00))*1.00) + (((agg(5120*aggs(3)*tidb_cpu_factor(49.9))) + (group(5120*cols(1)*tidb_cpu_factor(49.9))) + ((hashkey(4096*1*tidb_cpu_factor(49.9))) + (hashmem(4096*63*tidb_mem_factor(0.2))) + (hashbuild(4096*tidb_cpu_factor(49.9)))) + ((hashkey(5120*1*tidb_cpu_factor(49.9))) + (hashprobe(5120*tidb_cpu_factor(49.9)))))/5.00))*1.00 root group by:Column#41, funcs:count(1)->Column#37, funcs:sum(Column#40)->Column#38, funcs:firstrow(Column#41)->Column#36",
|
||||
" └─Projection_103 5120.00 1690649.77 (((cpu(10*3*tidb_cpu_factor(49.9))) + ((cpu(8000*filters(1)*tidb_cpu_factor(49.9))) + ((((((cpu(10000*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))))*1.00))) + (net(8000*rowsize(87)*tidb_flash_net_factor(2.2))))/15.00)*1.00)) + (((((((scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))))*1.00)) + (net(10000*rowsize(16)*tidb_flash_net_factor(2.2))))/15.00)*1.00) + ((hashkey(6400*1*tidb_cpu_factor(49.9))) + (hashmem(6400*87*tidb_mem_factor(0.2))) + (hashbuild(6400*tidb_cpu_factor(49.9)))) + (cpu(6400*filters(0)*tidb_cpu_factor(49.9))) + (((cpu(10000*filters(0)*tidb_cpu_factor(49.9))) + ((hashkey(10000*1*tidb_cpu_factor(49.9))) + (hashprobe(10000*tidb_cpu_factor(49.9)))))/5.00))*1.00) root test.customer.c_acctbal->Column#40, substring(test.customer.c_phone, 1, 2)->Column#41",
|
||||
" └─HashJoin_77 5120.00 1639041.19 ((cpu(10*3*tidb_cpu_factor(49.9))) + ((cpu(8000*filters(1)*tidb_cpu_factor(49.9))) + ((((((cpu(10000*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))))*1.00))) + (net(8000*rowsize(87)*tidb_flash_net_factor(2.2))))/15.00)*1.00)) + (((((((scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(16)*tiflash_scan_factor(11.6))))*1.00)) + (net(10000*rowsize(16)*tidb_flash_net_factor(2.2))))/15.00)*1.00) + ((hashkey(6400*1*tidb_cpu_factor(49.9))) + (hashmem(6400*87*tidb_mem_factor(0.2))) + (hashbuild(6400*tidb_cpu_factor(49.9)))) + (cpu(6400*filters(0)*tidb_cpu_factor(49.9))) + (((cpu(10000*filters(0)*tidb_cpu_factor(49.9))) + ((hashkey(10000*1*tidb_cpu_factor(49.9))) + (hashprobe(10000*tidb_cpu_factor(49.9)))))/5.00))*1.00 root anti semi join, left side:Selection_86, equal:[eq(test.customer.c_custkey, test.orders.o_custkey)]",
|
||||
" ├─Selection_86(Build) 6400.00 602530.86 (cpu(8000*filters(1)*tidb_cpu_factor(49.9))) + ((((((cpu(10000*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))))*1.00))) + (net(8000*rowsize(87)*tidb_flash_net_factor(2.2))))/15.00)*1.00) root gt(test.customer.c_acctbal, ScalarQueryCol#26)",
|
||||
" │ └─TableReader_93 8000.00 203330.86 (((((cpu(10000*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(87)*tiflash_scan_factor(11.6))))*1.00))) + (net(8000*rowsize(87)*tidb_flash_net_factor(2.2))))/15.00)*1.00 root MppVersion: 3, data:ExchangeSender_92",
|
||||
|
||||
@ -204,7 +204,7 @@ func enumeratePhysicalPlans4Task(
|
||||
iteration = iterateChildPlan4LogicalSequence
|
||||
}
|
||||
var fd *funcdep.FDSet
|
||||
if addEnforcer {
|
||||
if addEnforcer && len(physicalPlans) != 0 {
|
||||
switch logicalPlan := p.Self().(type) {
|
||||
case *logicalop.LogicalJoin, *logicalop.LogicalAggregation:
|
||||
// TODO(hawkingrei): FD should be maintained as logical prop instead of constructing it in physical phase
|
||||
|
||||
@ -2321,8 +2321,8 @@ func TestIssue46556(t *testing.T) {
|
||||
testkit.Rows(`HashJoin 0.00 root inner join, equal:[eq(Column#5, test.t0.c0)]`,
|
||||
`├─Projection(Build) 0.00 root <nil>->Column#5`,
|
||||
`│ └─TableDual 0.00 root rows:0`,
|
||||
`└─TableReader(Probe) 7992.00 root data:Selection`,
|
||||
` └─Selection 7992.00 cop[tikv] like(test.t0.c0, test.t0.c0, 92), not(isnull(test.t0.c0))`,
|
||||
`└─TableReader(Probe) 9990.00 root data:Selection`,
|
||||
` └─Selection 9990.00 cop[tikv] not(isnull(test.t0.c0))`,
|
||||
` └─TableFullScan 10000.00 cop[tikv] table:t0 keep order:false, stats:pseudo`))
|
||||
}
|
||||
|
||||
|
||||
@ -83,8 +83,8 @@ func Test53726(t *testing.T) {
|
||||
Check(testkit.Rows("-258025139 -258025139", "575932053 575932053"))
|
||||
tk.MustQuery("explain select distinct cast(c as decimal), cast(c as signed) from t7").
|
||||
Check(testkit.Rows(
|
||||
"HashAgg_6 2.00 root group by:Column#13, Column#14, funcs:firstrow(Column#13)->Column#3, funcs:firstrow(Column#14)->Column#4",
|
||||
"└─Projection_12 2.00 root cast(test.t7.c, decimal(10,0) BINARY)->Column#13, cast(test.t7.c, bigint(22) BINARY)->Column#14",
|
||||
"HashAgg_6 2.00 root group by:Column#11, Column#12, funcs:firstrow(Column#11)->Column#3, funcs:firstrow(Column#12)->Column#4",
|
||||
"└─Projection_12 2.00 root cast(test.t7.c, decimal(10,0) BINARY)->Column#11, cast(test.t7.c, bigint(22) BINARY)->Column#12",
|
||||
" └─TableReader_11 2.00 root data:TableFullScan_10",
|
||||
" └─TableFullScan_10 2.00 cop[tikv] table:t7 keep order:false"))
|
||||
}
|
||||
|
||||
@ -761,7 +761,9 @@ func (p *LogicalJoin) ExtractFDForSemiJoin(equivFromApply [][]intset.FastIntSet)
|
||||
|
||||
// ExtractFDForInnerJoin extracts FD for inner join.
|
||||
func (p *LogicalJoin) ExtractFDForInnerJoin(equivFromApply [][]intset.FastIntSet) *funcdep.FDSet {
|
||||
leftFD, rightFD := p.Children()[0].ExtractFD(), p.Children()[1].ExtractFD()
|
||||
child := p.Children()
|
||||
rightFD := child[1].ExtractFD()
|
||||
leftFD := child[0].ExtractFD()
|
||||
fds := leftFD
|
||||
fds.MakeCartesianProduct(rightFD)
|
||||
|
||||
|
||||
@ -200,7 +200,7 @@ func mergeInAndNotEQLists(sctx base.PlanContext, predicates []expression.Express
|
||||
sctx.GetExprCtx(),
|
||||
ithPredicate,
|
||||
jthPredicate)
|
||||
if iCol == jCol {
|
||||
if iCol.Equals(jCol) {
|
||||
if iType == notEqualPredicate && jType == inListPredicate {
|
||||
predicates[j], specialCase = updateInPredicate(sctx, jthPredicate, ithPredicate)
|
||||
if maybeOverOptimized4PlanCache {
|
||||
@ -245,7 +245,7 @@ func unsatisfiable(ctx base.PlanContext, p1, p2 expression.Expression) bool {
|
||||
var otherPred expression.Expression
|
||||
col1, p1Type := FindPredicateType(ctx, p1)
|
||||
col2, p2Type := FindPredicateType(ctx, p2)
|
||||
if col1 != col2 || col1 == nil {
|
||||
if col1 == nil || !col1.Equals(col2) {
|
||||
return false
|
||||
}
|
||||
if p1Type == equalPredicate {
|
||||
@ -385,7 +385,7 @@ func shortCircuitANDORLogicalConstants(sctx base.PlanContext, predicate expressi
|
||||
case secondType == falsePredicate && !orCase:
|
||||
return secondCondition, true
|
||||
default:
|
||||
if firstCondition != args[0] || secondCondition != args[1] {
|
||||
if !firstCondition.Equal(sctx.GetExprCtx().GetEvalCtx(), args[0]) || !secondCondition.Equal(sctx.GetExprCtx().GetEvalCtx(), args[1]) {
|
||||
finalResult := expression.NewFunctionInternal(sctx.GetExprCtx(), con.FuncName.L, con.GetStaticType(), firstCondition, secondCondition)
|
||||
return finalResult, true
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ func TestCollateSubQuery(t *testing.T) {
|
||||
tk.MustExec("create table t1(id varchar(100)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;")
|
||||
samePlan := testkit.Rows(
|
||||
"IndexHashJoin 8000.00 root inner join, inner:IndexLookUp, outer key:Column#6, inner key:test.t.col, equal cond:eq(Column#6, test.t.col)",
|
||||
"├─HashAgg(Build) 6400.00 root group by:Column#12, funcs:firstrow(Column#12)->Column#6",
|
||||
"├─HashAgg(Build) 6400.00 root group by:Column#11, funcs:firstrow(Column#11)->Column#6",
|
||||
"│ └─TableReader 6400.00 root data:HashAgg",
|
||||
"│ └─HashAgg 6400.00 cop[tikv] group by:cast(test.t1.id, var_string(5)), ",
|
||||
"│ └─Selection 8000.00 cop[tikv] not(isnull(cast(test.t1.id, var_string(5))))",
|
||||
|
||||
@ -39,6 +39,9 @@ func ExtractNotNullFromConds(conditions []expression.Expression, p base.LogicalP
|
||||
for _, condition := range conditions {
|
||||
var cols []*expression.Column
|
||||
cols = expression.ExtractColumnsFromExpressions(cols, []expression.Expression{condition}, nil)
|
||||
if len(cols) == 0 {
|
||||
continue
|
||||
}
|
||||
if IsNullRejected(p.SCtx(), p.Schema(), condition, false) {
|
||||
for _, col := range cols {
|
||||
notnullColsUniqueIDs.Insert(int(col.UniqueID))
|
||||
|
||||
@ -505,8 +505,8 @@ PRIMARY KEY (`id`)
|
||||
explain format = 'brief' SELECT COUNT(1) FROM (SELECT COALESCE(b.region_name, '不详') region_name, SUM(a.registration_num) registration_num FROM (SELECT stat_date, show_date, region_id, 0 registration_num FROM test01 WHERE period = 1 AND stat_date >= 20191202 AND stat_date <= 20191202 UNION ALL SELECT stat_date, show_date, region_id, registration_num registration_num FROM test01 WHERE period = 1 AND stat_date >= 20191202 AND stat_date <= 20191202) a LEFT JOIN test02 b ON a.region_id = b.id WHERE registration_num > 0 AND a.stat_date >= '20191202' AND a.stat_date <= '20191202' GROUP BY a.stat_date , a.show_date , COALESCE(b.region_name, '不详') ) JLS;
|
||||
id estRows task access object operator info
|
||||
StreamAgg 1.00 root funcs:count(1)->Column#22
|
||||
└─HashAgg 2.50 root group by:Column#48, Column#49, Column#50, funcs:count(1)->Column#36
|
||||
└─Projection 2.50 root Column#14->Column#48, Column#15->Column#49, coalesce(explain_easy.test02.region_name, 不详)->Column#50
|
||||
└─HashAgg 2.50 root group by:Column#47, Column#48, Column#49, funcs:count(1)->Column#36
|
||||
└─Projection 2.50 root Column#14->Column#47, Column#15->Column#48, coalesce(explain_easy.test02.region_name, 不详)->Column#49
|
||||
└─IndexJoin 2.50 root left outer join, inner:TableReader, left side:HashAgg, outer key:Column#16, inner key:explain_easy.test02.id, equal cond:eq(Column#16, explain_easy.test02.id)
|
||||
├─HashAgg(Build) 2.00 root group by:Column#14, Column#15, Column#16, funcs:firstrow(Column#33)->Column#14, funcs:firstrow(Column#34)->Column#15, funcs:firstrow(Column#35)->Column#16, funcs:count(1)->Column#37
|
||||
│ └─Union 2.00 root
|
||||
|
||||
@ -435,14 +435,14 @@ StreamAgg 4.80 root group by:upper(explain_generate_column_substitute.t.b), fun
|
||||
└─IndexFullScan 6.00 cop[tikv] table:t, index:expression_index_2(upper(`b`)) keep order:true
|
||||
desc format = 'brief' select count(upper(b)) from t use index() group by upper(b);
|
||||
id estRows task access object operator info
|
||||
HashAgg 6.00 root group by:Column#11, funcs:count(Column#11)->Column#7
|
||||
└─Projection 6.00 root upper(explain_generate_column_substitute.t.b)->Column#11
|
||||
HashAgg 6.00 root group by:Column#10, funcs:count(Column#10)->Column#7
|
||||
└─Projection 6.00 root upper(explain_generate_column_substitute.t.b)->Column#10
|
||||
└─TableReader 6.00 root data:TableFullScan
|
||||
└─TableFullScan 6.00 cop[tikv] table:t keep order:false
|
||||
desc format = 'brief' select max(upper(b)) from t use index() group by upper(b);
|
||||
id estRows task access object operator info
|
||||
HashAgg 6.00 root group by:Column#11, funcs:max(Column#11)->Column#7
|
||||
└─Projection 6.00 root upper(explain_generate_column_substitute.t.b)->Column#11
|
||||
HashAgg 6.00 root group by:Column#10, funcs:max(Column#10)->Column#7
|
||||
└─Projection 6.00 root upper(explain_generate_column_substitute.t.b)->Column#10
|
||||
└─TableReader 6.00 root data:TableFullScan
|
||||
└─TableFullScan 6.00 cop[tikv] table:t keep order:false
|
||||
drop table if exists t;
|
||||
|
||||
15
tests/integrationtest/r/null_rejected.result
Normal file
15
tests/integrationtest/r/null_rejected.result
Normal file
@ -0,0 +1,15 @@
|
||||
CREATE TABLE t1(c0 INT );
|
||||
CREATE VIEW v0(c0) AS SELECT NULL AS col_0 FROM t1 WHERE ((t1.c0));
|
||||
SELECT * FROM t1 JOIN (SELECT ((v0.c0) LIKE (((v0.c0) + (v0.c0)))) AS col_0 FROM v0) as subQuery1 ON (subQuery1.col_0);
|
||||
c0 col_0
|
||||
show warnings;
|
||||
Level Code Message
|
||||
EXPLAIN FORMAT='brief' SELECT * FROM t1 JOIN (SELECT ((v0.c0) LIKE (((v0.c0) + (v0.c0)))) AS col_0 FROM v0) as subQuery1 ON (subQuery1.col_0);
|
||||
id estRows task access object operator info
|
||||
HashJoin 53253333.33 root CARTESIAN inner join
|
||||
├─Projection(Build) 5325.33 root like(<nil>, cast(plus(cast(<nil>, double BINARY), cast(<nil>, double BINARY)), var_string(5)), 92)->Column#6
|
||||
│ └─TableReader 5325.33 root data:Selection
|
||||
│ └─Selection 5325.33 cop[tikv] like(NULL, cast(plus(cast(NULL, double BINARY), cast(NULL, double BINARY)), var_string(5)), 92), null_rejected.t1.c0
|
||||
│ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
|
||||
└─TableReader(Probe) 10000.00 root data:TableFullScan
|
||||
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
|
||||
@ -1209,8 +1209,8 @@ explain format = 'brief' select floor(dt.rn/2) rownum, count(c1) from (select @r
|
||||
id estRows task access object operator info
|
||||
Sort 1.00 root Column#6
|
||||
└─Projection 1.00 root floor(div(cast(Column#4, decimal(20,0) BINARY), 2))->Column#6, Column#5
|
||||
└─HashAgg 1.00 root group by:Column#14, funcs:count(Column#12)->Column#5, funcs:firstrow(Column#13)->Column#4
|
||||
└─Projection 10000.00 root planner__core__casetest__integration.t1.c1->Column#12, Column#4->Column#13, floor(div(cast(Column#4, decimal(20,0) BINARY), 2))->Column#14
|
||||
└─HashAgg 1.00 root group by:Column#13, funcs:count(Column#11)->Column#5, funcs:firstrow(Column#12)->Column#4
|
||||
└─Projection 10000.00 root planner__core__casetest__integration.t1.c1->Column#11, Column#4->Column#12, floor(div(cast(Column#4, decimal(20,0) BINARY), 2))->Column#13
|
||||
└─Projection 10000.00 root setvar(rownum, plus(getvar(rownum), 1))->Column#4, planner__core__casetest__integration.t1.c1
|
||||
└─HashJoin 10000.00 root CARTESIAN inner join
|
||||
├─Projection(Build) 1.00 root setvar(rownum, -1)->Column#1
|
||||
@ -1220,15 +1220,15 @@ Sort 1.00 root Column#6
|
||||
explain format = 'brief' select @n:=@n+1 as e from ta group by e;
|
||||
id estRows task access object operator info
|
||||
Projection 1.00 root setvar(n, plus(getvar(n), 1))->Column#4
|
||||
└─HashAgg 1.00 root group by:Column#9, funcs:firstrow(1)->Column#7
|
||||
└─Projection 10000.00 root setvar(n, plus(cast(getvar(n), double BINARY), 1))->Column#9
|
||||
└─HashAgg 1.00 root group by:Column#8, funcs:firstrow(1)->Column#7
|
||||
└─Projection 10000.00 root setvar(n, plus(cast(getvar(n), double BINARY), 1))->Column#8
|
||||
└─TableReader 10000.00 root data:TableFullScan
|
||||
└─TableFullScan 10000.00 cop[tikv] table:ta keep order:false, stats:pseudo
|
||||
explain format = 'brief' select @n:=@n+a as e from ta group by e;
|
||||
id estRows task access object operator info
|
||||
Projection 8000.00 root setvar(n, plus(getvar(n), cast(planner__core__casetest__integration.ta.a, double BINARY)))->Column#4
|
||||
└─HashAgg 8000.00 root group by:Column#8, funcs:firstrow(Column#7)->planner__core__casetest__integration.ta.a
|
||||
└─Projection 10000.00 root planner__core__casetest__integration.ta.a->Column#7, setvar(n, plus(getvar(n), cast(planner__core__casetest__integration.ta.a, double BINARY)))->Column#8
|
||||
└─HashAgg 8000.00 root group by:Column#7, funcs:firstrow(Column#6)->planner__core__casetest__integration.ta.a
|
||||
└─Projection 10000.00 root planner__core__casetest__integration.ta.a->Column#6, setvar(n, plus(getvar(n), cast(planner__core__casetest__integration.ta.a, double BINARY)))->Column#7
|
||||
└─TableReader 10000.00 root data:TableFullScan
|
||||
└─TableFullScan 10000.00 cop[tikv] table:ta keep order:false, stats:pseudo
|
||||
explain format = 'brief' select * from (select @n:=@n+1 as e from ta) tt group by e;
|
||||
@ -1245,14 +1245,14 @@ HashAgg 8000.00 root group by:Column#4, funcs:firstrow(Column#4)->Column#4
|
||||
└─TableFullScan 10000.00 cop[tikv] table:ta keep order:false, stats:pseudo
|
||||
explain format = 'brief' select a from ta group by @n:=@n+1;
|
||||
id estRows task access object operator info
|
||||
HashAgg 1.00 root group by:Column#6, funcs:firstrow(Column#5)->planner__core__casetest__integration.ta.a
|
||||
└─Projection 10000.00 root planner__core__casetest__integration.ta.a->Column#5, setvar(n, plus(getvar(n), 1))->Column#6
|
||||
HashAgg 1.00 root group by:Column#5, funcs:firstrow(Column#4)->planner__core__casetest__integration.ta.a
|
||||
└─Projection 10000.00 root planner__core__casetest__integration.ta.a->Column#4, setvar(n, plus(getvar(n), 1))->Column#5
|
||||
└─TableReader 10000.00 root data:TableFullScan
|
||||
└─TableFullScan 10000.00 cop[tikv] table:ta keep order:false, stats:pseudo
|
||||
explain format = 'brief' select a from ta group by @n:=@n+a;
|
||||
id estRows task access object operator info
|
||||
HashAgg 8000.00 root group by:Column#6, funcs:firstrow(Column#5)->planner__core__casetest__integration.ta.a
|
||||
└─Projection 10000.00 root planner__core__casetest__integration.ta.a->Column#5, setvar(n, plus(getvar(n), cast(planner__core__casetest__integration.ta.a, double BINARY)))->Column#6
|
||||
HashAgg 8000.00 root group by:Column#5, funcs:firstrow(Column#4)->planner__core__casetest__integration.ta.a
|
||||
└─Projection 10000.00 root planner__core__casetest__integration.ta.a->Column#4, setvar(n, plus(getvar(n), cast(planner__core__casetest__integration.ta.a, double BINARY)))->Column#5
|
||||
└─TableReader 10000.00 root data:TableFullScan
|
||||
└─TableFullScan 10000.00 cop[tikv] table:ta keep order:false, stats:pseudo
|
||||
set sql_mode=default;
|
||||
|
||||
@ -909,7 +909,7 @@ HashAgg 16000.00 root group by:Column#5, funcs:firstrow(Column#6)->Column#3
|
||||
│ └─IndexReader 8000.00 root index:HashAgg
|
||||
│ └─HashAgg 8000.00 cop[tikv] group by:date_format(planner__core__casetest__physicalplantest__physical_plan.tc.timestamp, "%Y-%m-%d %H"),
|
||||
│ └─IndexFullScan 10000.00 cop[tikv] table:tc, partition:p2020072312, index:idx_timestamp(timestamp) keep order:false, stats:pseudo
|
||||
└─HashAgg 8000.00 root group by:Column#11, funcs:firstrow(Column#11)->Column#6, funcs:firstrow(Column#11)->Column#5
|
||||
└─HashAgg 8000.00 root group by:Column#10, funcs:firstrow(Column#10)->Column#6, funcs:firstrow(Column#10)->Column#5
|
||||
└─IndexReader 8000.00 root index:HashAgg
|
||||
└─HashAgg 8000.00 cop[tikv] group by:date_format(planner__core__casetest__physicalplantest__physical_plan.tc.timestamp, "%Y-%m-%d %H"),
|
||||
└─IndexFullScan 10000.00 cop[tikv] table:tc, partition:p2020072313, index:idx_timestamp(timestamp) keep order:false, stats:pseudo
|
||||
@ -1355,8 +1355,8 @@ NULL 1 NULL
|
||||
explain format='brief' select date_format(d,'%Y') as df, sum(a), count(b), count(distinct c) from t group by date_format(d,'%Y');
|
||||
id estRows task access object operator info
|
||||
Projection 8000.00 root date_format(planner__core__casetest__physicalplantest__physical_plan.t.d, %Y)->Column#9, Column#6, cast(Column#13, bigint BINARY)->Column#7, Column#8
|
||||
└─HashAgg 8000.00 root group by:Column#24, funcs:sum(Column#20)->Column#6, funcs:sum(Column#21)->Column#13, funcs:count(Column#22)->Column#8, funcs:firstrow(Column#23)->planner__core__casetest__physicalplantest__physical_plan.t.d
|
||||
└─Projection 8000.00 root Column#11->Column#20, cast(Column#12, decimal(20,0) BINARY)->Column#21, planner__core__casetest__physicalplantest__physical_plan.t.c->Column#22, planner__core__casetest__physicalplantest__physical_plan.t.d->Column#23, date_format(planner__core__casetest__physicalplantest__physical_plan.t.d, %Y)->Column#24
|
||||
└─HashAgg 8000.00 root group by:Column#23, funcs:sum(Column#19)->Column#6, funcs:sum(Column#20)->Column#13, funcs:count(Column#21)->Column#8, funcs:firstrow(Column#22)->planner__core__casetest__physicalplantest__physical_plan.t.d
|
||||
└─Projection 8000.00 root Column#11->Column#19, cast(Column#12, decimal(20,0) BINARY)->Column#20, planner__core__casetest__physicalplantest__physical_plan.t.c->Column#21, planner__core__casetest__physicalplantest__physical_plan.t.d->Column#22, date_format(planner__core__casetest__physicalplantest__physical_plan.t.d, %Y)->Column#23
|
||||
└─HashAgg 8000.00 root group by:Column#14, planner__core__casetest__physicalplantest__physical_plan.t.c, funcs:sum(Column#15)->Column#11, funcs:count(Column#16)->Column#12, funcs:firstrow(planner__core__casetest__physicalplantest__physical_plan.t.c)->planner__core__casetest__physicalplantest__physical_plan.t.c, funcs:firstrow(Column#18)->planner__core__casetest__physicalplantest__physical_plan.t.d
|
||||
└─TableReader 8000.00 root data:HashAgg
|
||||
└─HashAgg 8000.00 cop[tikv] group by:date_format(planner__core__casetest__physicalplantest__physical_plan.t.d, "%Y"), planner__core__casetest__physicalplantest__physical_plan.t.c, funcs:sum(planner__core__casetest__physicalplantest__physical_plan.t.a)->Column#15, funcs:count(planner__core__casetest__physicalplantest__physical_plan.t.b)->Column#16, funcs:firstrow(planner__core__casetest__physicalplantest__physical_plan.t.d)->Column#18
|
||||
|
||||
@ -244,9 +244,9 @@ CREATE TABLE t1 (code varchar(10)) charset utf8mb4;
|
||||
CREATE TABLE t2 (id varchar(10) ) charset utf8mb4;
|
||||
EXPLAIN format='brief' SELECT * FROM t1 INNER JOIN t2 ON code=id WHERE id='a12' AND (LENGTH(code)=5 OR code < 'a00');
|
||||
id estRows task access object operator info
|
||||
HashJoin 10.83 root inner join, equal:[eq(planner__core__casetest__predicate_simplification.t1.code, planner__core__casetest__predicate_simplification.t2.id)], other cond:or(eq(length(planner__core__casetest__predicate_simplification.t1.code), 5), lt(planner__core__casetest__predicate_simplification.t2.id, "a00"))
|
||||
├─TableReader(Build) 8.66 root data:Selection
|
||||
│ └─Selection 8.66 cop[tikv] eq(planner__core__casetest__predicate_simplification.t1.code, "a12"), not(isnull(planner__core__casetest__predicate_simplification.t1.code)), or(eq(length(planner__core__casetest__predicate_simplification.t1.code), 5), lt(planner__core__casetest__predicate_simplification.t1.code, "a00"))
|
||||
HashJoin 10.00 root inner join, equal:[eq(planner__core__casetest__predicate_simplification.t1.code, planner__core__casetest__predicate_simplification.t2.id)], other cond:or(eq(length(planner__core__casetest__predicate_simplification.t1.code), 5), lt(planner__core__casetest__predicate_simplification.t2.id, "a00"))
|
||||
├─TableReader(Build) 8.00 root data:Selection
|
||||
│ └─Selection 8.00 cop[tikv] eq(length(planner__core__casetest__predicate_simplification.t1.code), 5), eq(planner__core__casetest__predicate_simplification.t1.code, "a12"), not(isnull(planner__core__casetest__predicate_simplification.t1.code))
|
||||
│ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
|
||||
└─TableReader(Probe) 10.00 root data:Selection
|
||||
└─Selection 10.00 cop[tikv] eq(planner__core__casetest__predicate_simplification.t2.id, "a12"), not(isnull(planner__core__casetest__predicate_simplification.t2.id))
|
||||
@ -287,7 +287,7 @@ HashJoin 12.50 root inner join, equal:[eq(planner__core__casetest__predicate_si
|
||||
│ └─Selection 10.00 cop[tikv] lt(planner__core__casetest__predicate_simplification.idt_mc21780.col1, 1976-09-09 20:21:11.000000), not(isnull(planner__core__casetest__predicate_simplification.idt_mc21780.col1)), or(eq(planner__core__casetest__predicate_simplification.idt_mc21780.col1, 2021-07-14 09:28:16.000000), or(eq(planner__core__casetest__predicate_simplification.idt_mc21780.col1, 1982-01-09 03:36:39.000000), eq(planner__core__casetest__predicate_simplification.idt_mc21780.col1, 1970-12-18 10:53:28.000000)))
|
||||
│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo
|
||||
└─TableReader(Probe) 10.00 root data:Selection
|
||||
└─Selection 10.00 cop[tikv] lt(planner__core__casetest__predicate_simplification.idt_mc21780.col1, 1976-09-09 20:21:11.000000), not(isnull(planner__core__casetest__predicate_simplification.idt_mc21780.col1)), or(eq(planner__core__casetest__predicate_simplification.idt_mc21780.col1, 2021-07-14 09:28:16.000000), or(eq(planner__core__casetest__predicate_simplification.idt_mc21780.col1, 1982-01-09 03:36:39.000000), eq(planner__core__casetest__predicate_simplification.idt_mc21780.col1, 1970-12-18 10:53:28.000000)))
|
||||
└─Selection 10.00 cop[tikv] eq(planner__core__casetest__predicate_simplification.idt_mc21780.col1, 1970-12-18 10:53:28.000000)
|
||||
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
|
||||
drop table if exists t1;
|
||||
drop table if exists t2;
|
||||
|
||||
@ -132,14 +132,14 @@ HashAgg_7 100.00 290007.67 root group by:Column#7, funcs:sum(Column#6)->Column#
|
||||
└─TableFullScan_11 100.00 250038.77 cop[tikv] table:t keep order:false
|
||||
explain format='verbose' select /*+ use_index(t, primary), hash_agg() */ sum(a) from t group by b, b+1;
|
||||
id estRows estCost task access object operator info
|
||||
HashAgg_7 100.00 304977.67 root group by:Column#10, Column#9, funcs:sum(Column#8)->Column#4
|
||||
└─Projection_13 100.00 272740.67 root cast(planner__core__plan_cost_ver2.t.a, decimal(10,0) BINARY)->Column#8, planner__core__plan_cost_ver2.t.b->Column#9, plus(planner__core__plan_cost_ver2.t.b, 1)->Column#10
|
||||
HashAgg_7 100.00 304977.67 root group by:Column#8, Column#9, funcs:sum(Column#7)->Column#4
|
||||
└─Projection_13 100.00 272740.67 root cast(planner__core__plan_cost_ver2.t.a, decimal(10,0) BINARY)->Column#7, planner__core__plan_cost_ver2.t.b->Column#8, plus(planner__core__plan_cost_ver2.t.b, 1)->Column#9
|
||||
└─TableReader_12 100.00 262710.77 root data:TableFullScan_11
|
||||
└─TableFullScan_11 100.00 250038.77 cop[tikv] table:t keep order:false
|
||||
explain format='verbose' select /*+ use_index(t, primary), hash_agg() */ sum(a) from t group by b, b+1, b+2;
|
||||
id estRows estCost task access object operator info
|
||||
HashAgg_7 100.00 319947.67 root group by:Column#11, Column#12, Column#13, funcs:sum(Column#10)->Column#4
|
||||
└─Projection_13 100.00 277730.67 root cast(planner__core__plan_cost_ver2.t.a, decimal(10,0) BINARY)->Column#10, planner__core__plan_cost_ver2.t.b->Column#11, plus(planner__core__plan_cost_ver2.t.b, 1)->Column#12, plus(planner__core__plan_cost_ver2.t.b, 2)->Column#13
|
||||
HashAgg_7 100.00 319947.67 root group by:Column#10, Column#11, Column#9, funcs:sum(Column#8)->Column#4
|
||||
└─Projection_13 100.00 277730.67 root cast(planner__core__plan_cost_ver2.t.a, decimal(10,0) BINARY)->Column#8, planner__core__plan_cost_ver2.t.b->Column#9, plus(planner__core__plan_cost_ver2.t.b, 1)->Column#10, plus(planner__core__plan_cost_ver2.t.b, 2)->Column#11
|
||||
└─TableReader_12 100.00 262710.77 root data:TableFullScan_11
|
||||
└─TableFullScan_11 100.00 250038.77 cop[tikv] table:t keep order:false
|
||||
explain format='verbose' select /*+ use_index(t, primary), stream_agg() */ sum(a) from t group by b;
|
||||
|
||||
@ -475,8 +475,8 @@ l_year;
|
||||
id estRows task access object operator info
|
||||
Sort 766.31 root tpch50.nation.n_name, tpch50.nation.n_name, Column#50
|
||||
└─Projection 766.31 root tpch50.nation.n_name, tpch50.nation.n_name, Column#50, Column#52
|
||||
└─HashAgg 766.31 root group by:Column#57, Column#58, Column#59, funcs:sum(Column#56)->Column#52, funcs:firstrow(Column#57)->tpch50.nation.n_name, funcs:firstrow(Column#58)->tpch50.nation.n_name, funcs:firstrow(Column#59)->Column#50
|
||||
└─Projection 1953718.78 root mul(tpch50.lineitem.l_extendedprice, minus(1, tpch50.lineitem.l_discount))->Column#56, tpch50.nation.n_name->Column#57, tpch50.nation.n_name->Column#58, extract(YEAR, tpch50.lineitem.l_shipdate)->Column#59
|
||||
└─HashAgg 766.31 root group by:Column#56, Column#57, Column#58, funcs:sum(Column#55)->Column#52, funcs:firstrow(Column#56)->tpch50.nation.n_name, funcs:firstrow(Column#57)->tpch50.nation.n_name, funcs:firstrow(Column#58)->Column#50
|
||||
└─Projection 1953718.78 root mul(tpch50.lineitem.l_extendedprice, minus(1, tpch50.lineitem.l_discount))->Column#55, tpch50.nation.n_name->Column#56, tpch50.nation.n_name->Column#57, extract(YEAR, tpch50.lineitem.l_shipdate)->Column#58
|
||||
└─Projection 1953718.78 root tpch50.lineitem.l_extendedprice, tpch50.lineitem.l_discount, tpch50.lineitem.l_shipdate, tpch50.nation.n_name, tpch50.nation.n_name
|
||||
└─HashJoin 1953718.78 root inner join, equal:[eq(tpch50.customer.c_nationkey, tpch50.nation.n_nationkey)], other cond:or(and(eq(tpch50.nation.n_name, "JAPAN"), eq(tpch50.nation.n_name, "INDIA")), and(eq(tpch50.nation.n_name, "INDIA"), eq(tpch50.nation.n_name, "JAPAN")))
|
||||
├─TableReader(Build) 2.00 root data:Selection
|
||||
@ -548,8 +548,8 @@ o_year;
|
||||
id estRows task access object operator info
|
||||
Sort 724.08 root Column#62
|
||||
└─Projection 724.08 root Column#62, div(Column#64, Column#65)->Column#66
|
||||
└─HashAgg 724.08 root group by:Column#75, funcs:sum(Column#73)->Column#64, funcs:sum(Column#74)->Column#65, funcs:firstrow(Column#75)->Column#62
|
||||
└─Projection 632534.06 root case(eq(tpch50.nation.n_name, INDIA), mul(tpch50.lineitem.l_extendedprice, minus(1, tpch50.lineitem.l_discount)), 0.0000)->Column#73, mul(tpch50.lineitem.l_extendedprice, minus(1, tpch50.lineitem.l_discount))->Column#74, extract(YEAR, tpch50.orders.o_orderdate)->Column#75
|
||||
└─HashAgg 724.08 root group by:Column#74, funcs:sum(Column#72)->Column#64, funcs:sum(Column#73)->Column#65, funcs:firstrow(Column#74)->Column#62
|
||||
└─Projection 632534.06 root case(eq(tpch50.nation.n_name, INDIA), mul(tpch50.lineitem.l_extendedprice, minus(1, tpch50.lineitem.l_discount)), 0.0000)->Column#72, mul(tpch50.lineitem.l_extendedprice, minus(1, tpch50.lineitem.l_discount))->Column#73, extract(YEAR, tpch50.orders.o_orderdate)->Column#74
|
||||
└─Projection 632534.06 root tpch50.lineitem.l_extendedprice, tpch50.lineitem.l_discount, tpch50.orders.o_orderdate, tpch50.nation.n_name
|
||||
└─HashJoin 632534.06 root inner join, equal:[eq(tpch50.supplier.s_nationkey, tpch50.nation.n_nationkey)]
|
||||
├─TableReader(Build) 25.00 root data:TableFullScan
|
||||
@ -624,8 +624,8 @@ o_year desc;
|
||||
id estRows task access object operator info
|
||||
Sort 2406.00 root tpch50.nation.n_name, Column#53:desc
|
||||
└─Projection 2406.00 root tpch50.nation.n_name, Column#53, Column#55
|
||||
└─HashAgg 2406.00 root group by:Column#61, Column#62, funcs:sum(Column#60)->Column#55, funcs:firstrow(Column#61)->tpch50.nation.n_name, funcs:firstrow(Column#62)->Column#53
|
||||
└─Projection 247789900.85 root minus(mul(tpch50.lineitem.l_extendedprice, minus(1, tpch50.lineitem.l_discount)), mul(tpch50.partsupp.ps_supplycost, tpch50.lineitem.l_quantity))->Column#60, tpch50.nation.n_name->Column#61, extract(YEAR, tpch50.orders.o_orderdate)->Column#62
|
||||
└─HashAgg 2406.00 root group by:Column#60, Column#61, funcs:sum(Column#59)->Column#55, funcs:firstrow(Column#60)->tpch50.nation.n_name, funcs:firstrow(Column#61)->Column#53
|
||||
└─Projection 247789900.85 root minus(mul(tpch50.lineitem.l_extendedprice, minus(1, tpch50.lineitem.l_discount)), mul(tpch50.partsupp.ps_supplycost, tpch50.lineitem.l_quantity))->Column#59, tpch50.nation.n_name->Column#60, extract(YEAR, tpch50.orders.o_orderdate)->Column#61
|
||||
└─Projection 247789900.85 root tpch50.lineitem.l_quantity, tpch50.lineitem.l_extendedprice, tpch50.lineitem.l_discount, tpch50.partsupp.ps_supplycost, tpch50.orders.o_orderdate, tpch50.nation.n_name
|
||||
└─HashJoin 247789900.85 root inner join, equal:[eq(tpch50.lineitem.l_orderkey, tpch50.orders.o_orderkey)]
|
||||
├─TableReader(Build) 75000000.00 root data:TableFullScan
|
||||
@ -1313,6 +1313,6 @@ cntrycode;
|
||||
id estRows task access object operator info
|
||||
Sort 1.00 root Column#31
|
||||
└─Projection 1.00 root Column#31, Column#32, Column#33
|
||||
└─HashAgg 1.00 root group by:Column#37, funcs:count(1)->Column#32, funcs:sum(Column#36)->Column#33, funcs:firstrow(Column#37)->Column#31
|
||||
└─Projection 0.00 root tpch50.customer.c_acctbal->Column#36, substring(tpch50.customer.c_phone, 1, 2)->Column#37
|
||||
└─HashAgg 1.00 root group by:Column#36, funcs:count(1)->Column#32, funcs:sum(Column#35)->Column#33, funcs:firstrow(Column#36)->Column#31
|
||||
└─Projection 0.00 root tpch50.customer.c_acctbal->Column#35, substring(tpch50.customer.c_phone, 1, 2)->Column#36
|
||||
└─TableDual 0.00 root rows:0
|
||||
|
||||
5
tests/integrationtest/t/null_rejected.test
Normal file
5
tests/integrationtest/t/null_rejected.test
Normal file
@ -0,0 +1,5 @@
|
||||
CREATE TABLE t1(c0 INT );
|
||||
CREATE VIEW v0(c0) AS SELECT NULL AS col_0 FROM t1 WHERE ((t1.c0));
|
||||
SELECT * FROM t1 JOIN (SELECT ((v0.c0) LIKE (((v0.c0) + (v0.c0)))) AS col_0 FROM v0) as subQuery1 ON (subQuery1.col_0);
|
||||
show warnings;
|
||||
EXPLAIN FORMAT='brief' SELECT * FROM t1 JOIN (SELECT ((v0.c0) LIKE (((v0.c0) + (v0.c0)))) AS col_0 FROM v0) as subQuery1 ON (subQuery1.col_0);
|
||||
Reference in New Issue
Block a user