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

planner: consider index path when the needed columns only contain handleCol #12021

Closed
francis0407 opened this issue Sep 4, 2019 · 0 comments · Fixed by #12022
Closed

planner: consider index path when the needed columns only contain handleCol #12021

francis0407 opened this issue Sep 4, 2019 · 0 comments · Fixed by #12022
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@francis0407
Copy link
Member

Feature Request

Is your feature request related to a problem? Please describe:

When we only want to get primary key, we can consider index path if there is no condition on the PK. For example:

create table t1 (a int primary key, b int, .... many columns, index idx_b(b));
create table t2 (a int, b int);

In this query, we can use IndexScan for t1.a:

select t2.a, t2.b
from t1, t2
where t1.a = t2.a;

We can also use a IndexScan for this one:

select count(1) from t1;
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.

1 participant