Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed Jan 10, 2023
1 parent 74f02ee commit ac74caf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions planner/core/plan_cost_ver2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ func TestCostModelShowFormula(t *testing.T) {
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec(`create table t (a int)`)
tk.MustExec("insert into t values (1), (2), (3)")
tk.MustExec("set @@tidb_cost_model_version=2")

tk.MustExecToErr("explain format='true_card_cost' select * from t") // 'true_card_cost' must work with 'explain analyze'
Expand All @@ -150,9 +149,9 @@ func TestCostModelShowFormula(t *testing.T) {
actual = append(actual, []interface{}{row[0], row[3]}) // id,costFormula
}
require.Equal(t, actual, [][]interface{}{
{"TableReader_7", "(((cpu(3*filters(1)*tikv_cpu_factor(49.9))) + (scan(3*logrowsize(32)*tikv_scan_factor(40.7)))) + (net(2*rowsize(16)*tidb_kv_net_factor(3.96))))/15.00"},
{"└─Selection_6", "(cpu(3*filters(1)*tikv_cpu_factor(49.9))) + (scan(3*logrowsize(32)*tikv_scan_factor(40.7)))"},
{" └─TableFullScan_5", "scan(3*logrowsize(32)*tikv_scan_factor(40.7))"},
{"TableReader_7", "(((cpu(0*filters(1)*tikv_cpu_factor(49.9))) + (scan(0*logrowsize(32)*tikv_scan_factor(40.7)))) + (net(0*rowsize(16)*tidb_kv_net_factor(3.96))))/15.00"},
{"└─Selection_6", "(cpu(0*filters(1)*tikv_cpu_factor(49.9))) + (scan(0*logrowsize(32)*tikv_scan_factor(40.7)))"},
{" └─TableFullScan_5", "scan(0*logrowsize(32)*tikv_scan_factor(40.7))"},
})
}

Expand Down

0 comments on commit ac74caf

Please sign in to comment.