-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
opt: wrong index chosen for point lookup #38800
Comments
Can you show the output with atats? I believe the row count for the index would be smaller than 1, which explains things. Perhaps we want to add a constant cost for index join (a cost comparable to scanning 1 row). |
with stats:
|
We have marked this issue as stale because it has been inactive for |
We now plan a constrained primary index scan for this query. |
Haven't dug into this, but it seems wrong:
I suspect we're choosing the secondary index because it has more columns that match the condition, but since the lookup columns contain the primary key there's still only one result either way, so avoiding the index join would be preferable.
The text was updated successfully, but these errors were encountered: