Re: does "select count(*) from mytable" always do a seq scan?

Поиск
Список
Период
Сортировка
От Culley Harrelson
Тема Re: does "select count(*) from mytable" always do a seq scan?
Дата
Msg-id 529825a30501070909256d76cd@mail.gmail.com
обсуждение исходный текст
Ответ на Re: does "select count(*) from mytable" always do a seq  (Tino Wildenhain <tino@wildenhain.de>)
Ответы Re: does "select count(*) from mytable" always do a seq scan?
Список pgsql-general
On Fri, 07 Jan 2005 16:17:16 +0100, Tino Wildenhain <tino@wildenhain.de> wrote:
>
> How do you think an index would help if you do an unconditional
> count(*)?

I really don't know <grin>.  I don't know the inner workings of
database internals but I would guess that there would be some
optimized way of counting the nodes in an index tree that would be
faster than sequentially going through a table.... I suppose there is
no free lunch.

One row, two rows, three rows, four rows, five rows.... <snore>

culley

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Transaction size
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Transaction size