Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: EXPLAIN on partitioned table should describe partitions #7523

Closed
morgo opened this issue Aug 29, 2018 · 1 comment
Closed

FR: EXPLAIN on partitioned table should describe partitions #7523

morgo opened this issue Aug 29, 2018 · 1 comment
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@morgo
Copy link
Contributor

morgo commented Aug 29, 2018

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
MySQL [test]> SHOW CREATE TABLE employees\G
*************************** 1. row ***************************
Table: employees
Create Table: CREATE TABLE `employees` (
`id` int(11) NOT NULL,
`fname` varchar(30) DEFAULT NULL,
`lname` varchar(30) DEFAULT NULL,
`hired` date NOT NULL DEFAULT '1970-01-01',
`separated` date NOT NULL DEFAULT '9999-12-31',
`store_id` int(11) NOT NULL,
PRIMARY KEY (`id`,`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
PARTITION BY RANGE ( `store_id` ) (
PARTITION p0 VALUES LESS THAN (6),
PARTITION p1 VALUES LESS THAN (11),
PARTITION p2 VALUES LESS THAN (16)
)
1 row in set (0.00 sec)

MySQL [test]> EXPLAIN SELECT * FROM employees WHERE store_id IN (5,6);
+-------------------------+----------+------+--------------------------------------------------------------------+
| id                      | count    | task | operator info                                                      |
+-------------------------+----------+------+--------------------------------------------------------------------+
| Union_8                 | 4.00     | root |                                                                    |
| ├─TableReader_11        | 2.00     | root | data:Selection_10                                                  |
| │ └─Selection_10        | 2.00     | cop  | in(test.employees.store_id, 5, 6)                                  |
| │   └─TableScan_9       | 10000.00 | cop  | table:employees, range:[-inf,+inf], keep order:false, stats:pseudo |
| └─TableReader_14        | 2.00     | root | data:Selection_13                                                  |
|   └─Selection_13        | 2.00     | cop  | in(test.employees.store_id, 5, 6)                                  |
|     └─TableScan_12      | 10000.00 | cop  | table:employees, range:[-inf,+inf], keep order:false, stats:pseudo |
+-------------------------+----------+------+--------------------------------------------------------------------+
7 rows in set (0.00 sec)
  1. What did you expect to see?

I would like to see the table:employees include the partition name. For example:
table:employees[p0]

This is helpful if I've used pd to move certain partition's regions to different geographic regions. I can confirm with EXPLAIN that the data ended up where expected.

  1. What did you see instead?

All partitions are named for the base table: employees.

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
MySQL [(none)]> SELECT tidb_version()\G                                                                                                                                                                                   *************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-rc.1-13-g1255973
Git Commit Hash: 1255973764f72575d71920b95fc0861d1677c6c5
Git Branch: master
UTC Build Time: 2018-08-28 07:35:57
GoVersion: go version go1.10.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
@zhexuany zhexuany added the type/enhancement The issue or PR belongs to an enhancement. label Sep 5, 2018
@morgo
Copy link
Contributor Author

morgo commented Sep 15, 2018

Added in #7505

@morgo morgo closed this as completed Sep 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants