Counting all rows

Поиск
Список
Период
Сортировка
От Stefan Arentz
Тема Counting all rows
Дата
Msg-id adf34c300706230315y43ba92daqf0804b7c377ffd29@mail.gmail.com
обсуждение исходный текст
Ответы Re: Counting all rows  (Andreas Kretschmer <akretschmer@spamfence.net>)
Список pgsql-sql
I need to get statistics from a bunch of tables. Simply the number of
records in them.

The query plan looks like this:

=> explain select count(id) from stuff;                           QUERY PLAN
-------------------------------------------------------------------Aggregate  (cost=1629.69..1629.70 rows=1 width=8)
-> Seq Scan on stuff  (cost=0.00..1517.75 rows=44775 width=8)
 

The sequential scan kind of worries me. Is there a better/faster way to do this?
S.S.


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

Предыдущее
От: "A. R. Van Hook"
Дата:
Сообщение: Re: join problem
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Counting all rows