Re: Feature request for adoptive indexes - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Feature request for adoptive indexes
Date
Msg-id CAH2-Wz=22epJjPp9Z+FaZt2Q+cVTDMr6EvGf8eOLrmFFjq-1Dg@mail.gmail.com
Whole thread Raw
In response to Re: Feature request for adoptive indexes  (Pavel Borisov <pashkin.elfe@gmail.com>)
Responses Re: Feature request for adoptive indexes  (Hayk Manukyan <manukyantt@gmail.com>)
List pgsql-hackers
On Wed, Oct 27, 2021 at 1:02 AM Pavel Borisov <pashkin.elfe@gmail.com> wrote:
> AFAIK Gin is lossy for phrase queries as we don't store word position in the posting list. For purely logical
queries,where position doesn't matter, it's not lossy.
 

GIN is always lossy, in the sense that it provides only a
gingetbitmap() routine -- there is no gingettuple() routine. I believe
that this is fundamental to the overall design of GIN. It would be
very difficult to add useful gingettuple() functionality now, since
GIN already relies on lossiness to avoid race conditions.

Here's an example of the problems that "adding gingettuple()" would
run into: Today, an index's pending list entries can be merged
concurrently with the entry tree, without worrying about returning the
same tuples twice. This is only safe/correct because GIN only supports
bitmap index scans. Without that, you need some other mechanism to
make it safe -- ISTM you must "logically lock" the index structure,
using ARIES/KVL style key value locks, or something along those lines.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Gilles Darold
Date:
Subject: Re: [PATCH] Proposal for HIDDEN/INVISIBLE column
Next
From: Jacob Champion
Date:
Subject: Re: allowing "map" for password auth methods with clientcert=verify-full