Re: Index AM change proposals, redux - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: Index AM change proposals, redux
Date
Msg-id 47FE5188.8060208@sigaev.ru
Whole thread Raw
In response to Re: Index AM change proposals, redux  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Index AM change proposals, redux  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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
storesmodified   original value which can be restored from index with call of specific   function - tsvector opclass
doesn'thave 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
impossibilityto get value from index. At least for GIN and GiST.
 



-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] libpq type system 0.9a
Next
From: Tom Lane
Date:
Subject: Re: Index AM change proposals, redux