pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedtracking last_autovacuum
4+ messages / 2 participants
[nested] [flat]
* tracking last_autovacuum
@ 2008-12-18 13:02 Stefano Nichele <stefano.nichele@gmail.com>
2008-12-18 13:07 ` Re: tracking last_autovacuum Alvaro Herrera <alvherre@commandprompt.com>
0 siblings, 1 reply; 4+ messages in thread
From: Stefano Nichele @ 2008-12-18 13:02 UTC (permalink / raw)
To: pgsql-admin
Hi All,
in pg_stat_all_tables, the fields last_autovacuum, last_autoanalyze are
updated any time autovacuum vacuums a table.
I would like to keep an history of these activities in order to see when
and how many times any single table is vacuumed.
Is there any features that can help me ? (I'm using postgres 8.2.9)
What about creating a trigger on pg_stat_all_tables and storing the
required info in another table (like autovacuum_history) ?
Cheers,
ste
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: tracking last_autovacuum
2008-12-18 13:02 tracking last_autovacuum Stefano Nichele <stefano.nichele@gmail.com>
@ 2008-12-18 13:07 ` Alvaro Herrera <alvherre@commandprompt.com>
2008-12-18 13:13 ` Re: tracking last_autovacuum Stefano Nichele <stefano.nichele@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Alvaro Herrera @ 2008-12-18 13:07 UTC (permalink / raw)
To: Stefano Nichele <stefano.nichele@gmail.com>; +Cc: pgsql-admin
Stefano Nichele escribió:
> Hi All,
> in pg_stat_all_tables, the fields last_autovacuum, last_autoanalyze are
> updated any time autovacuum vacuums a table.
> I would like to keep an history of these activities in order to see when
> and how many times any single table is vacuumed.
>
> Is there any features that can help me ? (I'm using postgres 8.2.9)
>
> What about creating a trigger on pg_stat_all_tables and storing the
> required info in another table (like autovacuum_history) ?
I guess you could run a query once every autovacuum_naptime and have it
save aside all those entries from pg_stat_all_tables that have recent
dates into a history table.
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: tracking last_autovacuum
2008-12-18 13:02 tracking last_autovacuum Stefano Nichele <stefano.nichele@gmail.com>
2008-12-18 13:07 ` Re: tracking last_autovacuum Alvaro Herrera <alvherre@commandprompt.com>
@ 2008-12-18 13:13 ` Stefano Nichele <stefano.nichele@gmail.com>
2008-12-18 13:16 ` Re: tracking last_autovacuum Alvaro Herrera <alvherre@commandprompt.com>
0 siblings, 1 reply; 4+ messages in thread
From: Stefano Nichele @ 2008-12-18 13:13 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@commandprompt.com>; +Cc: pgsql-admin
Yes, i could do that but it seems simpler (to me) with a trigger than
looking at the recent changes records and store them somewhere.
ste
Alvaro Herrera wrote:
> Stefano Nichele escribió:
>
>> Hi All,
>> in pg_stat_all_tables, the fields last_autovacuum, last_autoanalyze are
>> updated any time autovacuum vacuums a table.
>> I would like to keep an history of these activities in order to see when
>> and how many times any single table is vacuumed.
>>
>> Is there any features that can help me ? (I'm using postgres 8.2.9)
>>
>> What about creating a trigger on pg_stat_all_tables and storing the
>> required info in another table (like autovacuum_history) ?
>>
>
> I guess you could run a query once every autovacuum_naptime and have it
> save aside all those entries from pg_stat_all_tables that have recent
> dates into a history table.
>
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: tracking last_autovacuum
2008-12-18 13:02 tracking last_autovacuum Stefano Nichele <stefano.nichele@gmail.com>
2008-12-18 13:07 ` Re: tracking last_autovacuum Alvaro Herrera <alvherre@commandprompt.com>
2008-12-18 13:13 ` Re: tracking last_autovacuum Stefano Nichele <stefano.nichele@gmail.com>
@ 2008-12-18 13:16 ` Alvaro Herrera <alvherre@commandprompt.com>
0 siblings, 0 replies; 4+ messages in thread
From: Alvaro Herrera @ 2008-12-18 13:16 UTC (permalink / raw)
To: Stefano Nichele <stefano.nichele@gmail.com>; +Cc: pgsql-admin
Stefano Nichele escribió:
> Yes, i could do that but it seems simpler (to me) with a trigger than
> looking at the recent changes records and store them somewhere.
You can't have a trigger there, sorry.
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2008-12-18 13:16 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-12-18 13:02 tracking last_autovacuum Stefano Nichele <stefano.nichele@gmail.com>
2008-12-18 13:07 ` Alvaro Herrera <alvherre@commandprompt.com>
2008-12-18 13:13 ` Stefano Nichele <stefano.nichele@gmail.com>
2008-12-18 13:16 ` Alvaro Herrera <alvherre@commandprompt.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox