Re: count(*) performance

Поиск
Список
Период
Сортировка
От Mikael Carneholm
Тема Re: count(*) performance
Дата
Msg-id 7F10D26ECFA1FB458B89C5B4B0D72C2B088295@sesrv12.wirelesscar.com
обсуждение исходный текст
Ответ на count(*) performance  (Gábriel Ákos <akos.gabriel@i-logic.hu>)
Ответы Re: count(*) performance  ("Matthew T. O'Connor" <matthew@zeut.net>)
Список pgsql-performance
This is where a "last_vacuumed" (and "last_analyzed") column in
pg_statistic(?) would come in handy. Each time vacuum or analyze has
finished, update the row for the specific table that was
vacuumed/analyzed with a timestamp in the last_vacuumed/last_analyzed
column. No more guessing "maybe I haven't vacuumed/analyzed in a while",
and each time a user complains about bad performance, one could request
the user to do a "select s.last_vacuumed, s.last_analyzed from
pg_statistic s, pg_attribute a, pg_class c where ..."

It SOUNDS easy to implement, but that has fooled me before... :-)

- Mikael

-----Original Message-----
From: pgsql-performance-owner@postgresql.org
[mailto:pgsql-performance-owner@postgresql.org]On Behalf Of Guido
Neitzer
Sent: den 27 mars 2006 21:44
To: Brendan Duddridge
Cc: Postgresql Performance
Subject: Re: [PERFORM] count(*) performance


On 27.03.2006, at 21:20 Uhr, Brendan Duddridge wrote:

> Does that mean that even though autovacuum is turned on, you still
> should do a regular vacuum analyze periodically?

It seems that there are situations where autovacuum does not a really
good job.

However, in our application I have made stupid design decision which
I want to change as soon as possible. I have a "visit count" column
in one of the very large tables, so updates are VERY regular. I've
just checked and saw that autovacuum does a great job with that.

Nevertheless I have set up a cron job to do a standard vacuum every
month. I've used vacuum full only once after I did a bulk update of
about 200.000 rows ...

cug

--
PharmaLine, Essen, GERMANY
Software and Database Development



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

Предыдущее
От: "Rodrigo Madera"
Дата:
Сообщение: Large Binary Objects Middleware
Следующее
От: "Matthew T. O'Connor"
Дата:
Сообщение: Re: count(*) performance