Re: Much Ado About COUNT(*)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Much Ado About COUNT(*)
Дата
Msg-id 541.1105558916@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Much Ado About COUNT(*)  ("Jonah H. Harris" <jharris@tvi.edu>)
Ответы Re: Much Ado About COUNT(*)  ("Jonah H. Harris" <jharris@tvi.edu>)
Re: Much Ado About COUNT(*)  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список pgsql-hackers
"Jonah H. Harris" <jharris@tvi.edu> writes:
> My thinking is that we may be able to implement index usage for not only 
> unqualified counts, but also on any query that can be satisfied by the 
> index itself.

The fundamental problem is that you can't do it without adding at least
16 bytes, probably 20, to the size of an index tuple header.  That would
double the physical size of an index on a simple column (eg an integer
or timestamp).  The extra I/O costs and extra maintenance costs are
unattractive to say the least.  And it takes away some of the
justification for the whole thing, which is that reading an index is
much cheaper than reading the main table.  That's only true if the index
is much smaller than the main table ...
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: Much Ado About COUNT(*)
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: Much Ado About COUNT(*)