Re: [GENERAL] Yet Another (Simple) Case of Index not used

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: [GENERAL] Yet Another (Simple) Case of Index not used
Дата
Msg-id 20030408234623.GD15928@svana.org
обсуждение исходный текст
Ответы Re: [GENERAL] Yet Another (Simple) Case of Index not used  ("Denis @ Next2Me" <denis@next2me.com>)
Список pgsql-performance
On Tue, Apr 08, 2003 at 12:57:16PM -0700, Denis wrote:
> The query I am trying to do (fast) is:
>
> select count(*) from addresses;
>
> This takes more than a second to complete, because, as the 'explain' command
> shows me,
> the index created on 'addresses' is not used, and a seq scan is being used.
> One would assume that the creation of an index would allow the counting of
> the number of entries in a table to be instantanous?

Incorrect assumption. select count(*) can produce different results in
different backends depending on the current state of the active
transactions.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
>   - Samuel P. Huntington

Вложения

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

Предыдущее
От: Kevin Brown
Дата:
Сообщение: Re: ext3 filesystem / linux 7.3
Следующее
От: "Denis @ Next2Me"
Дата:
Сообщение: Re: [GENERAL] Yet Another (Simple) Case of Index not used