[YSQL] Partial indexes not picked up with redundant column in key #22233
Labels
area/ysql
Yugabyte SQL (YSQL)
kind/bug
This issue is a bug
priority/medium
Medium priority issue
status/awaiting-triage
Issue awaiting triage
Jira Link: DB-11153
Description
With a partial index filtering on one single value for a column, the presence of that column in the index key is redundant. The query planner seems to ignore that fact costs the access like a non-fully qualified predicate.
Example:
The query planner doesn't choose
i1
and then scans all status and filter later:The index
i1
is the best indexWorkaround 1: remove the partial clause
Workaround 2: remove the redundant column in the index key
Workaround 3: add redundant predicate that is not removed by partial index pruning
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: