Skip to content

Commit

Permalink
planner: let CopTiFlashConcurrencyFactor inflence the cost of whole p…
Browse files Browse the repository at this point in the history
…lan (pingcap#24157)
  • Loading branch information
hanfei1991 authored and LittleFall committed Jul 20, 2021
1 parent cc3ce22 commit ed5bb84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions planner/core/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -2053,11 +2053,11 @@ func (t *mppTask) convertToRootTaskImpl(ctx sessionctx.Context) *rootTask {
StoreType: kv.TiFlash,
}.Init(ctx, t.p.SelectBlockOffset())
p.stats = t.p.statsInfo()
p.cost = t.cost()
return &rootTask{
rt := &rootTask{
p: p,
cst: cst,
cst: t.cst / p.ctx.GetSessionVars().CopTiFlashConcurrencyFactor,
}
p.cost = rt.cost()
return rt
}

Expand Down
12 changes: 6 additions & 6 deletions planner/core/testdata/integration_serial_suite_out.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
{
"SQL": "explain format = 'verbose' select count(*) from t2 group by a",
"Plan": [
"TableReader_24 3.00 77.00 root data:ExchangeSender_23",
"TableReader_24 3.00 3.21 root data:ExchangeSender_23",
"└─ExchangeSender_23 3.00 77.00 batchCop[tiflash] ExchangeType: PassThrough",
" └─Projection_22 3.00 0.00 batchCop[tiflash] Column#4",
" └─HashAgg_8 3.00 77.00 batchCop[tiflash] group by:test.t2.a, funcs:count(1)->Column#4",
Expand Down Expand Up @@ -152,8 +152,8 @@
{
"SQL": "explain format = 'verbose' select count(*) from t1 join t2 on t1.a = t2.a",
"Plan": [
"StreamAgg_12 1.00 20.77 root funcs:count(1)->Column#7",
"└─TableReader_44 3.00 235.38 root data:ExchangeSender_43",
"StreamAgg_12 1.00 18.81 root funcs:count(1)->Column#7",
"└─TableReader_44 3.00 9.81 root data:ExchangeSender_43",
" └─ExchangeSender_43 3.00 235.38 cop[tiflash] ExchangeType: PassThrough",
" └─HashJoin_40 3.00 235.38 cop[tiflash] inner join, equal:[eq(test.t1.a, test.t2.a)]",
" ├─ExchangeReceiver_19(Build) 3.00 77.00 cop[tiflash] ",
Expand All @@ -167,11 +167,11 @@
{
"SQL": "explain format = 'verbose' select count(*) from t1 join t2 on t1.a = t2.a join t3 on t1.b = t3.b",
"Plan": [
"StreamAgg_15 1.00 62.68 root funcs:count(1)->Column#10",
"└─HashJoin_65 3.00 53.68 root inner join, equal:[eq(test.t1.b, test.t3.b)]",
"StreamAgg_15 1.00 60.48 root funcs:count(1)->Column#10",
"└─HashJoin_65 3.00 51.48 root inner join, equal:[eq(test.t1.b, test.t3.b)]",
" ├─IndexReader_53(Build) 3.00 11.66 root index:IndexFullScan_52",
" │ └─IndexFullScan_52 3.00 150.50 cop[tikv] table:t3, index:c(b) keep order:false",
" └─TableReader_39(Probe) 3.00 264.38 root data:ExchangeSender_38",
" └─TableReader_39(Probe) 3.00 11.02 root data:ExchangeSender_38",
" └─ExchangeSender_38 3.00 264.38 cop[tiflash] ExchangeType: PassThrough",
" └─HashJoin_29 3.00 264.38 cop[tiflash] inner join, equal:[eq(test.t1.a, test.t2.a)]",
" ├─ExchangeReceiver_35(Build) 3.00 106.00 cop[tiflash] ",
Expand Down

0 comments on commit ed5bb84

Please sign in to comment.