Re: Index Skip Scan

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: Index Skip Scan
Дата
Msg-id CAMkU=1x0984uC7PuupnnF6rVeMg6q3OwhU8k906mVZODstaGgQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Index Skip Scan  (Dmitry Dolgov <9erthalion6@gmail.com>)
Список pgsql-hackers
On Wed, Feb 20, 2019 at 11:33 AM Dmitry Dolgov <9erthalion6@gmail.com> wrote:
> On Fri, Feb 1, 2019 at 8:24 PM Jesper Pedersen <jesper.pedersen@redhat.com> wrote:
>
> Dmitry and I will look at this and take it into account for the next
> version.

In the meantime, just to not forget, I'm going to post another version with a
fix for cursor fetch backwards, which was crashing before.

This version of the patch can return the wrong answer.

create index on pgbench_accounts (bid, aid);
begin; declare c  cursor for select distinct on (bid) bid, aid from pgbench_accounts order by bid, aid;
fetch 2 from c;
 bid |   aid   
-----+---------
   1 |       1
   2 | 100,001

fetch backward 1 from c;
 bid |   aid   
-----+---------
   1 | 100,000

Without the patch, instead of getting a wrong answer, I get an error:

ERROR:  cursor can only scan forward
HINT:  Declare it with SCROLL option to enable backward scan.

If I add "SCROLL", then I do get the right answer with the patch.

Cheers,

Jeff

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Moser
Дата:
Сообщение: Re: [HACKERS] [PROPOSAL] Temporal query processing with range types
Следующее
От: Tom Lane
Дата:
Сообщение: Re: POC: converting Lists into arrays