Re: Index Skip Scan - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Index Skip Scan
Date
Msg-id CA+TgmoY7QTHhzLWZupNSyyqFRBfMgYocg3R-6g=DRgT4-KBGqg@mail.gmail.com
Whole thread Raw
In response to Re: Index Skip Scan  (Jesper Pedersen <jesper.pedersen@redhat.com>)
Responses Re: Index Skip Scan  (Dmitry Dolgov <9erthalion6@gmail.com>)
List pgsql-hackers
On Thu, Sep 13, 2018 at 11:40 AM Jesper Pedersen
<jesper.pedersen@redhat.com> wrote:
> > I noticed that current implementation doesn't
> > perform well when we have lots of small groups of equal values. Here is
> > the execution time of index skip scan vs unique over index scan, in ms,
> > depending on the size of group. The benchmark script is attached.
> >
> > group size    skip        unique
> > 1             2,293.85    132.55
> > 5             464.40      106.59
> > 10            239.61      102.02
> > 50            56.59       98.74
> > 100           32.56       103.04
> > 500           6.08        97.09
> >
>
> Yes, this doesn't look good. Using your test case I'm seeing that unique
> is being chosen when the group size is below 34, and skip above.

I'm not sure exactly how the current patch is approaching the problem,
but it seems like it might be reasonable to do something like -- look
for a distinct item within the current page; if not found, then search
from the root of the tree for the next item > the current item.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: AllocSetContextCreate changes breake extensions
Next
From: Andres Freund
Date:
Subject: Re: AllocSetContextCreate changes breake extensions