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
[YSQL] distinct pushdown requires a range predicate #16771
Labels
area/ysql
Yugabyte SQL (YSQL)
kind/enhancement
This is an enhancement of an existing feature
priority/medium
Medium priority issue
Comments
FranckPachot
added
area/ysql
Yugabyte SQL (YSQL)
status/awaiting-triage
Issue awaiting triage
labels
Apr 9, 2023
yugabyte-ci
added
kind/bug
This issue is a bug
priority/medium
Medium priority issue
labels
Apr 9, 2023
yugabyte-ci
added
kind/enhancement
This is an enhancement of an existing feature
and removed
kind/bug
This issue is a bug
status/awaiting-triage
Issue awaiting triage
labels
May 18, 2023
I tested on 2.19.3 and it seems it is the opposite:
Here |
Our planner picks the "expected" plan when we run analyze on the table.
Please reach out if there are any further questions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/ysql
Yugabyte SQL (YSQL)
kind/enhancement
This is an enhancement of an existing feature
priority/medium
Medium priority issue
Jira Link: DB-6127
Description
Issue: The distinct pushdown is not used when the Index Scan doesn't have an index condition.
Reproducible test case:
Without
b>0
1000 rows have been fetched from DocDB and deduplicated in YSQLWith
b>0
only 1 row which is the distinct value:Here is a more real-life test case:
https://dev.to/yugabyte/combining-postgresql-partial-index-yugabytedb-hybrid-scan-and-pushed-down-limit-to-get-a-scalable-bounded-count-distinct-3geo
Workaround: add a lower bound with a predicate in the WHERE clause, either by knowing the value (guaranteed by the datatype or check constraint) or with a (
select min() from
) which should be fast with the same index that allows hybrid scanWarning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: