Skip to content

Commit

Permalink
update test results
Browse files Browse the repository at this point in the history
  • Loading branch information
Reminiscent committed Jan 10, 2023
1 parent aadc563 commit a12c44d
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 38 deletions.
16 changes: 8 additions & 8 deletions planner/core/testdata/integration_suite_in.json
Original file line number Diff line number Diff line change
Expand Up @@ -695,16 +695,16 @@
"explain select /*+ no_keep_order(t1, idx_a) ignore_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;",

// Use the keep_order/ no_keep_order with the use_view hint at the same time
"select /*+ qb_name(qb, v) keep_order(t1, idx_a) */ * from v",
"select /*+ qb_name(qb, v) keep_order(t, primary) */ * from v1",
"select /*+ qb_name(qb, v) no_keep_order(t1, idx_a) */ * from v",
"select /*+ qb_name(qb, v) no_keep_order(t, primary) */ * from v1",
"explain select /*+ qb_name(qb, v) keep_order(t1@qb, idx_a) */ * from v",
"explain select /*+ qb_name(qb, v1) keep_order(t@qb, primary) */ * from v1",
"explain select /*+ qb_name(qb, v) no_keep_order(t1@qb, idx_a) */ * from v",
"explain select /*+ qb_name(qb, v1) no_keep_order(t@qb, primary) */ * from v1",

// Use the keep_order/ no_keep_order with CTE at the same time
"WITH CTE AS (select /*+ keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"WITH CTE AS (select /*+ keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"WITH CTE AS (select /*+ no_keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"WITH CTE AS (select /*+ no_keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;"
"explain WITH CTE AS (select /*+ keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"explain WITH CTE AS (select /*+ keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"explain WITH CTE AS (select /*+ no_keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"explain WITH CTE AS (select /*+ no_keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;"
]
},
{
Expand Down
128 changes: 98 additions & 30 deletions planner/core/testdata/integration_suite_out.json
Original file line number Diff line number Diff line change
Expand Up @@ -4654,53 +4654,121 @@
"Warn": null
},
{
"SQL": "select /*+ qb_name(qb, v) keep_order(t1, idx_a) */ * from v",
"Plan": null,
"Warn": [
"[planner:1815](test.t1, idx_a) is inapplicable, check whether the table(test.t1) exists"
]
"SQL": "explain select /*+ qb_name(qb, v) keep_order(t1@qb, idx_a) */ * from v",
"Plan": [
"Limit_14 1.00 root offset:0, count:1",
"└─Projection_19 1.00 root test.t1.a, test.t1.b",
" └─IndexLookUp_18 1.00 root ",
" ├─Limit_17(Build) 1.00 cop[tikv] offset:0, count:1",
" │ └─IndexRangeScan_15 1.00 cop[tikv] table:t1, index:idx_a(a) range:[-inf,10), keep order:true, stats:pseudo",
" └─TableRowIDScan_16(Probe) 1.00 cop[tikv] table:t1 keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "select /*+ qb_name(qb, v) keep_order(t, primary) */ * from v1",
"Plan": null,
"Warn": [
"[planner:1815](test.t, primary) is inapplicable, check whether the table(test.t) exists",
"The qb_name hint qb is unused, please check whether the table list in the qb_name hint qb is correct"
]
"SQL": "explain select /*+ qb_name(qb, v1) keep_order(t@qb, primary) */ * from v1",
"Plan": [
"Limit_13 1.00 root offset:0, count:1",
"└─TableReader_17 1.00 root data:Limit_16",
" └─Limit_16 1.00 cop[tikv] offset:0, count:1",
" └─TableRangeScan_15 333.33 cop[tikv] table:t range:[-inf,10), keep order:true, stats:pseudo"
],
"Warn": null
},
{
"SQL": "select /*+ qb_name(qb, v) no_keep_order(t1, idx_a) */ * from v",
"Plan": null,
"Warn": [
"[planner:1815](test.t1, idx_a) is inapplicable, check whether the table(test.t1) exists"
]
"SQL": "explain select /*+ qb_name(qb, v) no_keep_order(t1@qb, idx_a) */ * from v",
"Plan": [
"TopN_11 1.00 root test.t1.a, offset:0, count:1",
"└─IndexLookUp_18 1.00 root ",
" ├─TopN_17(Build) 1.00 cop[tikv] test.t1.a, offset:0, count:1",
" │ └─IndexRangeScan_15 3323.33 cop[tikv] table:t1, index:idx_a(a) range:[-inf,10), keep order:false, stats:pseudo",
" └─TableRowIDScan_16(Probe) 1.00 cop[tikv] table:t1 keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "select /*+ qb_name(qb, v) no_keep_order(t, primary) */ * from v1",
"Plan": null,
"Warn": [
"[planner:1815](test.t, primary) is inapplicable, check whether the table(test.t) exists",
"The qb_name hint qb is unused, please check whether the table list in the qb_name hint qb is correct"
]
"SQL": "explain select /*+ qb_name(qb, v1) no_keep_order(t@qb, primary) */ * from v1",
"Plan": [
"TopN_10 1.00 root test.t.a, offset:0, count:1",
"└─TableReader_17 1.00 root data:TopN_16",
" └─TopN_16 1.00 cop[tikv] test.t.a, offset:0, count:1",
" └─TableRangeScan_15 3333.33 cop[tikv] table:t range:[-inf,10), keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "WITH CTE AS (select /*+ keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"Plan": null,
"SQL": "explain WITH CTE AS (select /*+ keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"Plan": [
"HashAgg_30 2.00 root group by:Column#8, Column#9, funcs:firstrow(Column#8)->Column#8, funcs:firstrow(Column#9)->Column#9",
"└─Union_31 1.28 root ",
" ├─Selection_33 0.64 root lt(test.t1.a, 18)",
" │ └─CTEFullScan_34 0.80 root CTE:cte data:CTE_0",
" └─Selection_36 0.64 root gt(test.t1.b, 1)",
" └─CTEFullScan_37 0.80 root CTE:cte data:CTE_0",
"CTE_0 0.80 root Non-Recursive CTE",
"└─Selection_18(Seed Part) 0.80 root or(lt(test.t1.a, 18), gt(test.t1.b, 1))",
" └─Limit_24 1.00 root offset:0, count:1",
" └─Projection_29 1.00 root test.t1.a, test.t1.b",
" └─IndexLookUp_28 1.00 root ",
" ├─Limit_27(Build) 1.00 cop[tikv] offset:0, count:1",
" │ └─IndexRangeScan_25 1.00 cop[tikv] table:t1, index:idx_a(a) range:[-inf,10), keep order:true, stats:pseudo",
" └─TableRowIDScan_26(Probe) 1.00 cop[tikv] table:t1 keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "WITH CTE AS (select /*+ keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"Plan": null,
"SQL": "explain WITH CTE AS (select /*+ keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"Plan": [
"HashAgg_28 2.00 root group by:Column#7, Column#8, funcs:firstrow(Column#7)->Column#7, funcs:firstrow(Column#8)->Column#8",
"└─Union_29 1.28 root ",
" ├─Selection_31 0.64 root lt(test.t.a, 18)",
" │ └─CTEFullScan_32 0.80 root CTE:cte data:CTE_0",
" └─Selection_34 0.64 root gt(test.t.b, 1)",
" └─CTEFullScan_35 0.80 root CTE:cte data:CTE_0",
"CTE_0 0.80 root Non-Recursive CTE",
"└─Selection_18(Seed Part) 0.80 root or(lt(test.t.a, 18), gt(test.t.b, 1))",
" └─Limit_23 1.00 root offset:0, count:1",
" └─TableReader_27 1.00 root data:Limit_26",
" └─Limit_26 1.00 cop[tikv] offset:0, count:1",
" └─TableRangeScan_25 333.33 cop[tikv] table:t range:[-inf,10), keep order:true, stats:pseudo"
],
"Warn": null
},
{
"SQL": "WITH CTE AS (select /*+ no_keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"Plan": null,
"SQL": "explain WITH CTE AS (select /*+ no_keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"Plan": [
"HashAgg_29 2.00 root group by:Column#8, Column#9, funcs:firstrow(Column#8)->Column#8, funcs:firstrow(Column#9)->Column#9",
"└─Union_30 1.28 root ",
" ├─Selection_32 0.64 root lt(test.t1.a, 18)",
" │ └─CTEFullScan_33 0.80 root CTE:cte data:CTE_0",
" └─Selection_35 0.64 root gt(test.t1.b, 1)",
" └─CTEFullScan_36 0.80 root CTE:cte data:CTE_0",
"CTE_0 0.80 root Non-Recursive CTE",
"└─Selection_18(Seed Part) 0.80 root or(lt(test.t1.a, 18), gt(test.t1.b, 1))",
" └─TopN_21 1.00 root test.t1.a, offset:0, count:1",
" └─IndexLookUp_28 1.00 root ",
" ├─TopN_27(Build) 1.00 cop[tikv] test.t1.a, offset:0, count:1",
" │ └─IndexRangeScan_25 3323.33 cop[tikv] table:t1, index:idx_a(a) range:[-inf,10), keep order:false, stats:pseudo",
" └─TableRowIDScan_26(Probe) 1.00 cop[tikv] table:t1 keep order:false, stats:pseudo"
],
"Warn": null
},
{
"SQL": "WITH CTE AS (select /*+ no_keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"Plan": null,
"SQL": "explain WITH CTE AS (select /*+ no_keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;",
"Plan": [
"HashAgg_28 2.00 root group by:Column#7, Column#8, funcs:firstrow(Column#7)->Column#7, funcs:firstrow(Column#8)->Column#8",
"└─Union_29 1.28 root ",
" ├─Selection_31 0.64 root lt(test.t.a, 18)",
" │ └─CTEFullScan_32 0.80 root CTE:cte data:CTE_0",
" └─Selection_34 0.64 root gt(test.t.b, 1)",
" └─CTEFullScan_35 0.80 root CTE:cte data:CTE_0",
"CTE_0 0.80 root Non-Recursive CTE",
"└─Selection_18(Seed Part) 0.80 root or(lt(test.t.a, 18), gt(test.t.b, 1))",
" └─TopN_20 1.00 root test.t.a, offset:0, count:1",
" └─TableReader_27 1.00 root data:TopN_26",
" └─TopN_26 1.00 cop[tikv] test.t.a, offset:0, count:1",
" └─TableRangeScan_25 3333.33 cop[tikv] table:t range:[-inf,10), keep order:false, stats:pseudo"
],
"Warn": null
}
]
Expand Down

0 comments on commit a12c44d

Please sign in to comment.