Re: Date range for pg_stat_all_tables? - Mailing list pgsql-admin

From Ronit Allen
Subject Re: Date range for pg_stat_all_tables?
Date
Msg-id CABP1cDOYYXSQOqYxp=MkEswyHYQ8MjAm=SMLpd3N3Jbr+3vWOw@mail.gmail.com
Whole thread Raw
In response to Re: Date range for pg_stat_all_tables?  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Responses Re: Date range for pg_stat_all_tables?
List pgsql-admin
Hi -

Thanks for below.

On 9.1 with postgresql.conf left at defaults, what period of time does a query on pg_stat_all_tables cover?

Let's say my database has been running for exactly one year.

I then issue SELECT relname, n_tup_ins FROM pg_stat_all_tables;

Do the results show me inserts for the last 7 days? 30 days? all time?..

I don't see the answer to this in http://www.postgresql.org/docs/9.1/static/monitoring-stats.html (or maybe it is there and I am not understanding).

Thanks once again,
Ronit





On Tue, Nov 13, 2012 at 10:54 AM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
Ronit Allen wrote:
> I have the following query on pg_stat_all_tables to look at updates,
inserts, and deletes:
>
> SELECT relname, n_tup_ins, n_tup_upd, n_tup_del FROM
pg_stat_all_tables;
>
> How can I add a date range to the WHERE clause to show data from a
specified date range?
>
> I don't see anything in the table or in possible joins that will
provide dates.
>
> Thanks for any assistance that can be provided.

If you want that, you will have to take regular snapshots
of the table (e.g. with a cron job).
Then you can calculate differences.

Yours,
Laurenz Albe

pgsql-admin by date:

Previous
From: Craig James
Date:
Subject: Re: Failed Login Attempts parameter
Next
From: Stephen Frost
Date:
Subject: Re: Failed Login Attempts parameter