|
6945 | 6945 | "Warning": null
|
6946 | 6946 | }
|
6947 | 6947 | ]
|
| 6948 | + }, |
| 6949 | + { |
| 6950 | + "Name": "TestIssues49377Plan", |
| 6951 | + "Cases": [ |
| 6952 | + { |
| 6953 | + "SQL": "select 1,1,1 union all ((select * from employee where dept_id = 1) union all ( select * from employee where dept_id = 1 order by employee_id ) order by 1 );", |
| 6954 | + "Plan": [ |
| 6955 | + "Union 21.00 root ", |
| 6956 | + "├─Projection 1.00 root 1->Column#15, 1->Column#16, 1->Column#17", |
| 6957 | + "│ └─TableDual 1.00 root rows:1", |
| 6958 | + "└─Projection 20.00 root cast(Column#12, bigint(11) BINARY)->Column#15, Column#13, cast(Column#14, bigint(11) BINARY)->Column#17", |
| 6959 | + " └─Sort 20.00 root Column#12", |
| 6960 | + " └─Union 20.00 root ", |
| 6961 | + " ├─TableReader 10.00 root data:Selection", |
| 6962 | + " │ └─Selection 10.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 6963 | + " │ └─TableFullScan 10000.00 cop[tikv] table:employee keep order:false, stats:pseudo", |
| 6964 | + " └─Sort 10.00 root test.employee.employee_id", |
| 6965 | + " └─TableReader 10.00 root data:Selection", |
| 6966 | + " └─Selection 10.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 6967 | + " └─TableFullScan 10000.00 cop[tikv] table:employee keep order:false, stats:pseudo" |
| 6968 | + ], |
| 6969 | + "Warning": null |
| 6970 | + }, |
| 6971 | + { |
| 6972 | + "SQL": "select 1,1,1 union all ((select * from employee where dept_id = 1) union all ( select * from employee where dept_id = 1 order by employee_id ) order by 1 limit 1);", |
| 6973 | + "Plan": [ |
| 6974 | + "Union 2.00 root ", |
| 6975 | + "├─Projection 1.00 root 1->Column#15, 1->Column#16, 1->Column#17", |
| 6976 | + "│ └─TableDual 1.00 root rows:1", |
| 6977 | + "└─Projection 1.00 root cast(Column#12, bigint(11) BINARY)->Column#15, Column#13, cast(Column#14, bigint(11) BINARY)->Column#17", |
| 6978 | + " └─TopN 1.00 root Column#12, offset:0, count:1", |
| 6979 | + " └─Union 2.00 root ", |
| 6980 | + " ├─TopN 1.00 root test.employee.employee_id, offset:0, count:1", |
| 6981 | + " │ └─TableReader 1.00 root data:TopN", |
| 6982 | + " │ └─TopN 1.00 cop[tikv] test.employee.employee_id, offset:0, count:1", |
| 6983 | + " │ └─Selection 10.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 6984 | + " │ └─TableFullScan 10000.00 cop[tikv] table:employee keep order:false, stats:pseudo", |
| 6985 | + " └─TopN 1.00 root test.employee.employee_id, offset:0, count:1", |
| 6986 | + " └─TableReader 1.00 root data:TopN", |
| 6987 | + " └─TopN 1.00 cop[tikv] test.employee.employee_id, offset:0, count:1", |
| 6988 | + " └─Selection 10.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 6989 | + " └─TableFullScan 10000.00 cop[tikv] table:employee keep order:false, stats:pseudo" |
| 6990 | + ], |
| 6991 | + "Warning": null |
| 6992 | + }, |
| 6993 | + { |
| 6994 | + "SQL": "select * from employee where dept_id = 1 union all ( select * from employee where dept_id = 1 order by employee_id) union all ( select * from employee where dept_id = 1 union all ( select * from employee where dept_id = 1 order by employee_id ) limit 1);", |
| 6995 | + "Plan": [ |
| 6996 | + "Union 21.00 root ", |
| 6997 | + "├─TableReader 10.00 root data:Selection", |
| 6998 | + "│ └─Selection 10.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 6999 | + "│ └─TableFullScan 10000.00 cop[tikv] table:employee keep order:false, stats:pseudo", |
| 7000 | + "├─Sort 10.00 root test.employee.employee_id", |
| 7001 | + "│ └─TableReader 10.00 root data:Selection", |
| 7002 | + "│ └─Selection 10.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 7003 | + "│ └─TableFullScan 10000.00 cop[tikv] table:employee keep order:false, stats:pseudo", |
| 7004 | + "└─Limit 1.00 root offset:0, count:1", |
| 7005 | + " └─Union 1.00 root ", |
| 7006 | + " ├─Limit 1.00 root offset:0, count:1", |
| 7007 | + " │ └─TableReader 1.00 root data:Limit", |
| 7008 | + " │ └─Limit 1.00 cop[tikv] offset:0, count:1", |
| 7009 | + " │ └─Selection 1.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 7010 | + " │ └─TableFullScan 1000.00 cop[tikv] table:employee keep order:false, stats:pseudo", |
| 7011 | + " └─TopN 1.00 root test.employee.employee_id, offset:0, count:1", |
| 7012 | + " └─TableReader 1.00 root data:TopN", |
| 7013 | + " └─TopN 1.00 cop[tikv] test.employee.employee_id, offset:0, count:1", |
| 7014 | + " └─Selection 10.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 7015 | + " └─TableFullScan 10000.00 cop[tikv] table:employee keep order:false, stats:pseudo" |
| 7016 | + ], |
| 7017 | + "Warning": null |
| 7018 | + }, |
| 7019 | + { |
| 7020 | + "SQL": "select * from employee where dept_id = 1 union all ( select * from employee where dept_id = 1 order by employee_id) union all ( select * from employee where dept_id = 1 union all ( select * from employee where dept_id = 1 order by employee_id ) order by 1 limit 1);", |
| 7021 | + "Plan": [ |
| 7022 | + "Union 21.00 root ", |
| 7023 | + "├─TableReader 10.00 root data:Selection", |
| 7024 | + "│ └─Selection 10.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 7025 | + "│ └─TableFullScan 10000.00 cop[tikv] table:employee keep order:false, stats:pseudo", |
| 7026 | + "├─Sort 10.00 root test.employee.employee_id", |
| 7027 | + "│ └─TableReader 10.00 root data:Selection", |
| 7028 | + "│ └─Selection 10.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 7029 | + "│ └─TableFullScan 10000.00 cop[tikv] table:employee keep order:false, stats:pseudo", |
| 7030 | + "└─TopN 1.00 root Column#17, offset:0, count:1", |
| 7031 | + " └─Union 2.00 root ", |
| 7032 | + " ├─TopN 1.00 root test.employee.employee_id, offset:0, count:1", |
| 7033 | + " │ └─TableReader 1.00 root data:TopN", |
| 7034 | + " │ └─TopN 1.00 cop[tikv] test.employee.employee_id, offset:0, count:1", |
| 7035 | + " │ └─Selection 10.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 7036 | + " │ └─TableFullScan 10000.00 cop[tikv] table:employee keep order:false, stats:pseudo", |
| 7037 | + " └─TopN 1.00 root test.employee.employee_id, offset:0, count:1", |
| 7038 | + " └─TableReader 1.00 root data:TopN", |
| 7039 | + " └─TopN 1.00 cop[tikv] test.employee.employee_id, offset:0, count:1", |
| 7040 | + " └─Selection 10.00 cop[tikv] eq(test.employee.dept_id, 1)", |
| 7041 | + " └─TableFullScan 10000.00 cop[tikv] table:employee keep order:false, stats:pseudo" |
| 7042 | + ], |
| 7043 | + "Warning": null |
| 7044 | + } |
| 7045 | + ] |
6948 | 7046 | }
|
6949 | 7047 | ]
|
0 commit comments