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

remove invalid predicates after partition pruning #22079

Closed
XuHuaiyu opened this issue Dec 29, 2020 · 1 comment · Fixed by #24282
Closed

remove invalid predicates after partition pruning #22079

XuHuaiyu opened this issue Dec 29, 2020 · 1 comment · Fixed by #24282
Assignees
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@XuHuaiyu
Copy link
Contributor

Development Task

table schema:

CREATE TABLE `t` (
  `a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
PARTITION BY RANGE ( `a` ) (
  PARTITION `p0` VALUES LESS THAN (1),
  PARTITION `p1` VALUES LESS THAN (2),
  PARTITION `p2` VALUES LESS THAN (3),
  PARTITION `p_max` VALUES LESS THAN (MAXVALUE)
)

query:

desc select * from t where a = 1;
+-------------------------+----------+-----------+-----------------------+--------------------------------+
| id                      | estRows  | task      | access object         | operator info                  |
+-------------------------+----------+-----------+-----------------------+--------------------------------+
| TableReader_9           | 10.00    | root      |                       | data:Selection_8               |
| └─Selection_8           | 10.00    | cop[tikv] |                       | eq(test.t.a, 1)                |
|   └─TableFullScan_7     | 10000.00 | cop[tikv] | table:t, partition:p1 | keep order:false, stats:pseudo |
+-------------------------+----------+-----------+-----------------------+--------------------------------+
3 rows in set (0.00 sec)

Actually, we can remove the a=1 after partition pruning for this case.

@XuHuaiyu XuHuaiyu added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner labels Dec 29, 2020
@zhuo-zhi
Copy link
Contributor

/assign

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
Development

Successfully merging a pull request may close this issue.

2 participants