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

optimize the list columns partition pruner #21383

Closed
crazycs520 opened this issue Nov 30, 2020 · 0 comments · Fixed by #21577 or #21997
Closed

optimize the list columns partition pruner #21383

crazycs520 opened this issue Nov 30, 2020 · 0 comments · Fixed by #21577 or #21997
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@crazycs520
Copy link
Contributor

1. Minimal reproduce step (Required)

create table t (a bigint, b int) partition by list columns (a,b) (partition p0 values in ((1,1),(2,2)), partition p1 values in ((3,3)));

2. What did you expect to see? (Required)

test> desc select * from t where a=1;
+------------------------+----------+-----------+-----------------------+--------------------------------+
| id                     | estRows  | task      | access object         | operator info                  |
+------------------------+----------+-----------+-----------------------+--------------------------------+
| PartitionUnion_8       | 20.00    | root      |                       |                                |
| ├─TableReader_11       | 10.00    | root      |                       | data:Selection_10              |
| │ └─Selection_10       | 10.00    | cop[tikv] |                       | eq(test.t.a, 1)                |
| │   └─TableFullScan_9  | 10000.00 | cop[tikv] | table:t, partition:p0 | keep order:false, stats:pseudo |
+------------------------+----------+-----------+-----------------------+--------------------------------+

3. What did you see instead (Required)

test> desc select * from t where a=1;
+------------------------+----------+-----------+-----------------------+--------------------------------+
| id                     | estRows  | task      | access object         | operator info                  |
+------------------------+----------+-----------+-----------------------+--------------------------------+
| PartitionUnion_8       | 20.00    | root      |                       |                                |
| ├─TableReader_11       | 10.00    | root      |                       | data:Selection_10              |
| │ └─Selection_10       | 10.00    | cop[tikv] |                       | eq(test.t.a, 1)                |
| │   └─TableFullScan_9  | 10000.00 | cop[tikv] | table:t, partition:p0 | keep order:false, stats:pseudo |
| └─TableReader_14       | 10.00    | root      |                       | data:Selection_13              |
|   └─Selection_13       | 10.00    | cop[tikv] |                       | eq(test.t.a, 1)                |
|     └─TableFullScan_12 | 10000.00 | cop[tikv] | table:t, partition:p1 | keep order:false, stats:pseudo |
+------------------------+----------+-----------+-----------------------+--------------------------------+

4. What is your TiDB version? (Required)

> select tidb_version();
+-------------------------------------------------------------------+
| tidb_version()                                                    |
+-------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-1676-g3e073c8a0                    |
| Edition: Community                                                |
| Git Commit Hash: 3e073c8a0878db6ab85ce255ad7db804e35d5225         |
| Git Branch: master                                                |
| UTC Build Time: 2020-11-30 08:57:47                               |
| GoVersion: go1.14.4                                               |
| Race Enabled: false                                               |
| TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 |
| Check Table Before Drop: false                                    |
+-------------------------------------------------------------------+
@crazycs520 crazycs520 added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner labels Nov 30, 2020
@crazycs520 crazycs520 added difficulty/medium help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Nov 30, 2020
@crazycs520 crazycs520 removed the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
3 participants