Re: the big picture for index-only scans

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: the big picture for index-only scans
Дата
Msg-id 4DCA5907020000250003D559@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: the big picture for index-only scans  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
Bruce Momjian <bruce@momjian.us> wrote:
>> The very fact that Kevin and yourself bring up different reasons
>> for why we need this feature makes me nervous.
> 
> Yes, no question.  For count(*), you don't care about the indexed
> values, only the count, while for Kevin's case you are reading
> values from the index.
[sigh]  I'm reluctant to draw out this digression further, but there
is a possibly-useful point to be made here: these are not two
different things.  A covering index can be considered whenever the
set of columns referenced in the query is contained inside the set
of columns in the index.  The fact that the set of columns needed by
count(*) is the empty set merely means that it is covered by any
index, since the empty set is contained in every set.
Now, this special case may make for an easy initial target in
implementation, or allow early benchmarking.  If so, all the better
to go there first.  I'm not sure why anyone would stop there,
though; if it pays off for that simple case it is likely to pay off
for the more general case, too.
-Kevin


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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: PGC_S_DEFAULT is inadequate
Следующее
От: Tom Lane
Дата:
Сообщение: Re: the big picture for index-only scans