Re: Database Select Slow

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: Database Select Slow
Дата
Msg-id 20070810124247.GA6206@a-kretschmer.de
обсуждение исходный текст
Ответ на Database Select Slow  ("carter ck" <carterck32@hotmail.com>)
Ответы Re: Database Select Slow
Список pgsql-general
am  Fri, dem 10.08.2007, um 17:46:11 +0800 mailte carter ck folgendes:
> Hi all,
>
> I am facing a performance issue here. Whenever I do a count(*) on a table
> that contains about 300K records, it takes few minutes to complete. Whereas
> my other application which is counting > 500K records just take less than
> 10 seconds to complete.
>
> I have indexed all the essential columns and still it does not improve the
> speed.

Indexes don't help in this case, a 'select count(*)' forces a seq. scan.
Do you realy need this information? An estimate for the number of rows
can you find in the system catalog (reltuples in pg_class, see
http://www.postgresql.org/docs/current/interactive/catalog-pg-class.html)


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

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

Предыдущее
От: Alejandro Torras
Дата:
Сообщение: [PROPOSAL] DML value format
Следующее
От: Marc Rossi
Дата:
Сообщение: Re: UPDATES hang every 5 minutes