Vaccum and analyze counters in pgstat

Lists: pgsql-hackers
From: Magnus Hagander <magnus(at)hagander(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Vaccum and analyze counters in pgstat
Date: 2010-08-20 12:45:56
Message-ID: AANLkTik7EUijOiswF45uyccPm3vMD0pnnWevDF2UqB9J@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Attached is a patch that adds columns to pg_stat_*_tables for number
of [auto]vacuum and [auto]analyze runs on a table, completing the
current one that just had the last time these ran. It's particularly
useful to see how much autovac is doing on the tables, but I included
the counts of regular vacuum and analyze as well for completeness.

Comments?

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

Attachment Content-Type Size
stat_vacuum_counters.patch application/octet-stream 11.5 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Vaccum and analyze counters in pgstat
Date: 2010-08-20 13:49:50
Message-ID: 16332.1282312190@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> Attached is a patch that adds columns to pg_stat_*_tables for number
> of [auto]vacuum and [auto]analyze runs on a table, completing the
> current one that just had the last time these ran. It's particularly
> useful to see how much autovac is doing on the tables, but I included
> the counts of regular vacuum and analyze as well for completeness.

> Comments?

Looks reasonably sane in a quick read-through.

> --- 117,125 ----
> is a subsystem that supports collection and reporting of information about
> server activity. Presently, the collector can count accesses to tables
> and indexes in both disk-block and individual-row terms. It also tracks
> ! the total number of rows in each table, and information about vacuum and
> ! analyze for each table. It can also count calls to user-defined functions
> ! and the total time spent in each one.
> </para>

"information about vacuum and analyze actions" might read better.

> --- 318,325 ----
> <entry>Similar to <structname>pg_stat_all_tables</>, but counts actions
> taken so far within the current transaction (which are <emphasis>not</>
> yet included in <structname>pg_stat_all_tables</> and related views).
> ! The columns for numbers of live and dead rows and vacuum and
> ! analyze values are not present in this view.</entry>
> </row>

Likewise values -> actions here.

regards, tom lane


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Vaccum and analyze counters in pgstat
Date: 2010-08-21 11:07:07
Message-ID: AANLkTikvG+P70ChCNzMjSeP9ky-Chrj9_OjoBhUKhRCc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Aug 20, 2010 at 15:49, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> Attached is a patch that adds columns to pg_stat_*_tables for number
>> of [auto]vacuum and [auto]analyze runs on a table, completing the
>> current one that just had the last time these ran. It's particularly
>> useful to see how much autovac is doing on the tables, but I included
>> the counts of regular vacuum and analyze as well for completeness.
>
>> Comments?
>
> Looks reasonably sane in a quick read-through.

Applied with suggested documentation changes.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/