Re: range_agg

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Zhihong Yu <zyu(at)yugabyte(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Jeff Davis <pgsql(at)j-davis(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: range_agg
Date: 2020-12-27 19:38:38
Message-ID: CAPpHfdva3ZZwg-WO66O+F08TZZfz_ED=mbYbeG5-DsPohrzhaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Dec 27, 2020 at 9:07 PM David Fetter <david(at)fetter(dot)org> wrote:
> On Sun, Dec 27, 2020 at 09:53:13AM -0800, Zhihong Yu wrote:
> > This is not an ideal way to index multirages, but something we can
> > easily have.
>
> What sort of indexing improvements do you have in mind?

Approximation of multirange as a range can cause false positives.
It's good if gaps are small, but what if they aren't.

Ideally, we should split multirange to the ranges and index them
separately. So, we would need a GIN-like index. The problem is that
the GIN entry tree is a B-tree, which is not very useful for searching
for ranges. If we could replace the GIN entry tree with GiST or
SP-GiST, that should be good. We could index multirage parts
separately and big gaps wouldn't be a problem. Similar work was
already prototyped (it was prototyped under the name "vodka", but I'm
not a big fan of this name). FWIW, such a new access method would
need a lot of work to bring it to commit. I don't think it would be
reasonable, before multiranges get popular.

Regarding the GiST opclass, it seems the best we can do in GiST.

------
Regards,
Alexander Korotkov

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2020-12-27 19:47:56 Re: Parallel Inserts in CREATE TABLE AS
Previous Message Alexander Korotkov 2020-12-27 19:31:27 Re: range_agg