Re: Feature request for adoptive indexes

From: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Hayk Manukyan <manukyantt(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Feature request for adoptive indexes
Date: 2021-10-27 08:02:23
Message-ID: CALT9ZEHTW+LuHZReQi1shJ6sVkcfBGWZ70Sk4-OzaEb6T7JaMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> It's no coincidence that GIN indexes (which
> have some of the same issues) only support lossy index scans.
>
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.

One more consideration against the proposal is that if we want to select
with more than one "suffix" columns in the WHERE clause, effectively we
will have a join of two separate index scans. And as we consider suffix
columns to be highly selective, and prefix columns are weakly selective,
then it could be very slow.

Just some ideas on the topic which may not be connected to OP proposal (Not
sure whether should we implement them as a part of nbtree) :

1. If prefix columns have low selectivity it may be good if we have some
attribute-level deduplication only for prefix columns.
2. If we have several suffix columns, it might be a good idea is to treat
them as an n-dimensional space and define some R-tree or Quad-tree on top
of them (using GiST, SpGIST).

--
Best regards,
Pavel Borisov

Postgres Professional: http://postgrespro.com <http://www.postgrespro.com>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ronan Dunklau 2021-10-27 08:11:00 Re: pg_receivewal starting position
Previous Message Ronan Dunklau 2021-10-27 08:00:40 Re: pg_receivewal starting position