-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
type/feature-requestCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
- What did you do?
If possible, provide a recipe for reproducing the error.
CREATE TABLE partition_table (x int) PARTITION BY RANGE (x) (
PARTITION p1 VALUES LESS THAN (100),
PARTITION p2 VALUES LESS THAN (200)
);It works without union
mysql> desc select * from partition_table where x > 100 ;
+---------------------+----------+-----------+----------------------------------------------------------------------------------------+
| id | count | task | operator info |
+---------------------+----------+-----------+----------------------------------------------------------------------------------------+
| TableReader_8 | 3333.33 | root | data:Selection_7 |
| └─Selection_7 | 3333.33 | cop[tikv] | gt(Column#1, 100) |
| └─TableScan_6 | 10000.00 | cop[tikv] | table:partition_table, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo |
+---------------------+----------+-----------+----------------------------------------------------------------------------------------+
3 rows in set (0.01 sec)-
What did you expect to see?
-
What did you see instead?
But it does not work with one part of union.
mysql> desc select * from partition_table where x > 100 union select * from partition_table where x > 100;
+--------------------------------+----------+-----------+----------------------------------------------------------------------------------------+
| id | count | task | operator info |
+--------------------------------+----------+-----------+----------------------------------------------------------------------------------------+
| HashAgg_17 | 8000.00 | root | group by:Column#7, funcs:firstrow(Column#7) |
| └─Union_18 | 10000.00 | root | |
| ├─Union_20 | 6666.67 | root | |
| │ ├─TableReader_23 | 3333.33 | root | data:Selection_22 |
| │ │ └─Selection_22 | 3333.33 | cop[tikv] | gt(Column#4, 100) |
| │ │ └─TableScan_21 | 10000.00 | cop[tikv] | table:partition_table, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo |
| │ └─TableReader_26 | 3333.33 | root | data:Selection_25 |
| │ └─Selection_25 | 3333.33 | cop[tikv] | gt(Column#4, 100) |
| │ └─TableScan_24 | 10000.00 | cop[tikv] | table:partition_table, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo |
| └─TableReader_30 | 3333.33 | root | data:Selection_29 |
| └─Selection_29 | 3333.33 | cop[tikv] | gt(Column#1, 100) |
| └─TableScan_28 | 10000.00 | cop[tikv] | table:partition_table, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo |
+--------------------------------+----------+-----------+----------------------------------------------------------------------------------------+
12 rows in set (0.00 sec)- What version of TiDB are you using (
tidb-server -Vor runselect tidb_version();on TiDB)?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type/feature-requestCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.