Re: Index-only-scans, indexam API changes

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема Re: Index-only-scans, indexam API changes
Дата
Msg-id 4A6F1D57.1000204@sigaev.ru
обсуждение исходный текст
Ответ на Re: Index-only-scans, indexam API changes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Laurent Laborde
Дата:
Сообщение: Re: Higher TOAST compression.
Следующее
От: Greg Smith
Дата:
Сообщение: Re: multi-threaded pgbench