-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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] JSONB condition using an index will return all rows when there are no hits #3896
Comments
Confirming that it works in 2.1.0 but breaks in 2.1.1 |
interesting detail is that -- recreate index since it was dropped in the repro sql statements
CREATE INDEX books_author_first_name ON books ((details->'author'->>'first_name'));
-- this shouldn't return any rows and it works as expected
SELECT id from books where details->'author'->>'first_name' LIKE 'Hello World'; |
The issue can be reproduced with 2.1.2 as well |
Thanks for reporting @lhotari . We've identified the root cause and should have the fix available in next minor release. |
Summary: This regression is due the following commit eeab192 ``` commit eeab192 Author: neil <nocaway@users.noreply.github.com> Date: 2020-02-24 [YSQL] #3103 Improve performance when running index scan to query data ``` When no-ybctid is found from the IndexTable, PgGate should stop the processing effort and return empty result-set. However, it continues processing SELECT from the main table and issues a read request for full-scan. This bug only affect the scenarios where no ybctid is found by the secondary-index scan. When ybctids are found, PgGate issues a read request for only those ybctids. Test Plan: Extend test yb_perf_secondary_index_scan.sql for the reported issue. Reviewers: kannan, mihnea Reviewed By: kannan, mihnea Subscribers: kannan, yql Differential Revision: https://phabricator.dev.yugabyte.com/D8118
This has been fixed by commit 9f4448d Our next release should have it. |
There's a regression in 2.1.1.0-b2 when using JSONB conditions using an index. All rows are returned when there are no hits.
There's a repro here: https://github.com/lhotari/yugabyte-bugs-repro#json-index-bug
Also with this SQL:
Easy to try out with docker:
The text was updated successfully, but these errors were encountered: