Re: Index-only-scans, indexam API changes - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: Index-only-scans, indexam API changes
Date
Msg-id 4A6F1D57.1000204@sigaev.ru
Whole thread Raw
In response to Re: Index-only-scans, indexam API changes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> [ 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: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From: Laurent Laborde
Date:
Subject: Re: Higher TOAST compression.
Next
From: Greg Smith
Date:
Subject: Re: multi-threaded pgbench