[ thinks a bit ... ]  At least for GIST, it is possible that whether
data can be regurgitated will vary depending on the selected opclass.
Some opclasses use the STORAGE modifier and some don't.  I am not sure
how hard we want to work to support flexibility there.  Would it be
sufficient to hard-code the check as "pgam says the AM can do it,
and the opclass does not have a STORAGE property"?  Or do we need
additional intelligence about GIST opclasses?

GiST: btree_gist uses STORAGE option, although original value is accessible from index's tuple.

GIN doesn't require setting of STORAGE option even if it's impossible to reconstruct original heap value from indexed value. Right now, only btree_gin's opclasses could be used for index only scans (and only for single-column index scan!).

So, STORAGE option could not indicate "reconstruct-ability" original heap value :(. It seems to me, opclass definition could contain boolean field about that, but with STORAGE option specified it's needed to have separate "reconstructing" interface method. IMHO, it's too complex for now and it doesn't give significant benefits.

Although index-only scan over GIN/GiST could be useful for some aggregates queries like count(*).

--
Teodor Sigaev                                   E-mail: teo...@sigaev.ru
                                                   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