select count...

Поиск
Список
Период
Сортировка
От P. Dwayne Miller
Тема select count...
Дата
Msg-id 3B4DF035.B623D72D@espgroup.net
обсуждение исходный текст
Список pgsql-hackers
What's the fastest way to select the number of rows in a table?  If I
use count(*) with no whereclause, it uses a seq_scan and takes 4 secs
(122k rows).  With a where clause, it uses an index and returns in < 1
sec.  Selecting count(requestnumber), which is an indexed column, with
no where clause again takes 4 secs.  This latter version, I thought,
would use the index.  The values of requestnumber are very distributed.

Thanks



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

Предыдущее
От: Jean-Michel POURE
Дата:
Сообщение: Dependency tracking
Следующее
От: "Mikheev, Vadim"
Дата:
Сообщение: RE: Re: Strangeness in xid allocation / snapshot setup