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: [EMAIL PROTECTED]
                                                   WWW: http://www.sigaev.ru/

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to