> On Thu, Feb 28, 2019 at 10:45 PM Jeff Janes <jeff.ja...@gmail.com> wrote: > > This version of the patch can return the wrong answer.
Yes, indeed. In fact it answers my previous question related to the backward cursor scan, when while going back we didn't skip enough. Within the current approach it can be fixed by proper skipping for backward scan, something like in the attached patch. Although there are still some rough edges, e.g. going forth, back and forth again leads to a sutiation, when `_bt_first` is not applied anymore and the first element is wrongly skipped. I'll try to fix it with the next version of patch. > If we accept this patch, I hope it would be expanded in the future to give > similar performance as the above query does even when the query is written in > its more natural way of: Yeah, I hope the current approach with a new index am routine can be extended for that. > Without the patch, instead of getting a wrong answer, I get an error: Right, as far as I can see without a skip scan and SCROLL, a unique + index scan is used, where amcanbackward is false by default. So looks like it's not really patch related.
v10-0001-Index-skip-scan.patch
Description: Binary data