Re: Index AM change proposals, redux

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Index AM change proposals, redux
Date: 2008-04-10 17:42:32
Message-ID: 47FE5188.8060208@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> GiST too, because type of storage may be differ from type to be indexed. The
>> same touches GIN too.
>
> Is this the case for *all* GiST and GIN indexes, or might we need a
> per-index (rather than per-AM) flag to tell whether the original keys
> are available?

Ughm. GiST and GIN are different here. For GiST it is clear that is per index
flag:
- rtree emulation over box stores original values
- rtree emulation over points or circles, btree_gist, ltree stores modified
original value which can be restored from index with call of specific
function
- tsvector opclass doesn't have this possibility at all
So, only rtree emulation over box is able to return original value from index.
For GIN index I know only one opclass where it's possible to get original value,
it's a wildspeed, but in any case that requires some transformation before.
However, it's possible to develop opclass for GIN which will be similar to
classic Btree, for indexing scalar values.

Both GIN and GiST make a call of transformation function before indexing value.
I suppose, there is no automatic way to set this flag even in case when type of
storage and type of indexing value are the same.

So, I see three variant:
- add flag in pg_am
- add flag to create operator class and by default it should point to
impossibility to get value from index. At least for GIN and GiST.

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-04-10 17:42:59 Re: Index AM change proposals, redux
Previous Message Tom Lane 2008-04-10 17:40:53 Re: [PATCHES] libpq type system 0.9a