Re: Index Skip Scan - Mailing list pgsql-hackers

From Dmitry Dolgov
Subject Re: Index Skip Scan
Date
Msg-id CA+q6zcVJXRnsLXDK21knNnUpebWuTA-rpj5vHToA9Tyw5N+qaw@mail.gmail.com
Whole thread Raw
In response to Re: Index Skip Scan  (Floris Van Nee <florisvannee@Optiver.com>)
List pgsql-hackers
> On Sat, Jun 1, 2019 at 5:34 PM Floris Van Nee <florisvannee@optiver.com> wrote:
>
> I did a little bit of investigation and it seems to occur because in
> pathkeys.c the function pathkey_is_redundant considers pathkeys redundant if
> there is an equality condition with a constant in the corresponding WHERE
> clause.
> ...
> However, the index skip scan interprets this as that it has to skip over just
> the first column.

Right, passing correct number of columns fixes this particular problem. But
while debugging I've also discovered another related issue, when the current
implementation seems to have a few assumptions, that are not correct if we have
an index condition and a distinct column is not the first in the index. I'll
try to address these in a next version of the patch in the nearest future.



pgsql-hackers by date:

Previous
From: Floris Van Nee
Date:
Subject: Re: Index Skip Scan
Next
From: Tom Lane
Date:
Subject: Re: coverage increase for worker_spi