Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed Nov 9, 2022
1 parent b6b8e00 commit b4eab94
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
4 changes: 4 additions & 0 deletions planner/core/physical_plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2173,6 +2173,7 @@ func TestHJBuildAndProbeHint(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("set tidb_cost_model_version=2")
tk.MustExec("drop table if exists t1, t2, t3")
tk.MustExec("create table t1(a int primary key, b int not null)")
tk.MustExec("create table t2(a int primary key, b int not null)")
Expand Down Expand Up @@ -2209,6 +2210,7 @@ func TestHJBuildAndProbeHint4StaticPartitionTable(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("set tidb_cost_model_version=2")
tk.MustExec("drop table if exists t1, t2, t3")
tk.MustExec(`create table t1(a int, b int) partition by hash(a) partitions 4`)
tk.MustExec(`create table t2(a int, b int) partition by hash(a) partitions 5`)
Expand Down Expand Up @@ -2283,6 +2285,7 @@ func TestHJBuildAndProbeHint4TiFlash(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("set tidb_cost_model_version=2")
tk.MustExec("drop table if exists t1, t2, t3")
tk.MustExec("create table t1(a int primary key, b int not null)")
tk.MustExec("create table t2(a int primary key, b int not null)")
Expand Down Expand Up @@ -2321,6 +2324,7 @@ func TestHJBuildAndProbeHintWithBinding(t *testing.T) {

tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("set tidb_cost_model_version=2")
tk.MustExec("drop table if exists t, t1, t2, t3;")
tk.MustExec("create table t(a int, b int, key(a));")
tk.MustExec("create table t1(a int, b int, key(a));")
Expand Down
28 changes: 16 additions & 12 deletions planner/core/testdata/plan_suite_out.json
Original file line number Diff line number Diff line change
Expand Up @@ -5171,9 +5171,10 @@
"SQL": "SELECT /*+ hash_join_probe(t1) */ * FROM t1 WHERE EXISTS (SELECT /*+ SEMI_JOIN_REWRITE() */ 1 FROM t2 WHERE t2.a = t1.a);",
"Plan": [
"HashJoin 10000.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]",
"├─HashAgg(Build) 8000.00 root group by:test.t2.a, funcs:firstrow(test.t2.a)->test.t2.a",
"│ └─TableReader 10000.00 root data:TableFullScan",
"│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo",
"├─StreamAgg(Build) 8000.00 root group by:test.t2.a, funcs:firstrow(test.t2.a)->test.t2.a",
"│ └─TableReader 8000.00 root data:StreamAgg",
"│ └─StreamAgg 8000.00 cop[tikv] group by:test.t2.a, ",
"│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo",
"└─TableReader(Probe) 10000.00 root data:TableFullScan",
" └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo"
],
Expand All @@ -5189,9 +5190,10 @@
"HashJoin 10000.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]",
"├─TableReader(Build) 10000.00 root data:TableFullScan",
"│ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo",
"└─HashAgg(Probe) 8000.00 root group by:test.t2.a, funcs:firstrow(test.t2.a)->test.t2.a",
" └─TableReader 10000.00 root data:TableFullScan",
" └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo"
"└─StreamAgg(Probe) 8000.00 root group by:test.t2.a, funcs:firstrow(test.t2.a)->test.t2.a",
" └─TableReader 8000.00 root data:StreamAgg",
" └─StreamAgg 8000.00 cop[tikv] group by:test.t2.a, ",
" └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo"
],
"Result": [
"1 1",
Expand Down Expand Up @@ -5239,9 +5241,10 @@
"HashJoin 10000.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]",
"├─TableReader(Build) 10000.00 root data:TableFullScan",
"│ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo",
"└─HashAgg(Probe) 8000.00 root group by:test.t2.a, funcs:firstrow(test.t2.a)->test.t2.a",
" └─TableReader 10000.00 root data:TableFullScan",
" └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo"
"└─StreamAgg(Probe) 8000.00 root group by:test.t2.a, funcs:firstrow(test.t2.a)->test.t2.a",
" └─TableReader 8000.00 root data:StreamAgg",
" └─StreamAgg 8000.00 cop[tikv] group by:test.t2.a, ",
" └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo"
],
"Result": [
"1 1",
Expand All @@ -5253,9 +5256,10 @@
"SQL": "SELECT /*+ hash_join_build(t2@sel_2) */ * FROM t1 WHERE EXISTS (SELECT /*+ SEMI_JOIN_REWRITE() */ 1 FROM t2 WHERE t2.a = t1.a);",
"Plan": [
"HashJoin 10000.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]",
"├─HashAgg(Build) 8000.00 root group by:test.t2.a, funcs:firstrow(test.t2.a)->test.t2.a",
"│ └─TableReader 10000.00 root data:TableFullScan",
"│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo",
"├─StreamAgg(Build) 8000.00 root group by:test.t2.a, funcs:firstrow(test.t2.a)->test.t2.a",
"│ └─TableReader 8000.00 root data:StreamAgg",
"│ └─StreamAgg 8000.00 cop[tikv] group by:test.t2.a, ",
"│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo",
"└─TableReader(Probe) 10000.00 root data:TableFullScan",
" └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo"
],
Expand Down

0 comments on commit b4eab94

Please sign in to comment.