Re: DB Size - How much is growing - PostgreSQL 9.2 - Mailing list pgsql-admin

From David G. Johnston
Subject Re: DB Size - How much is growing - PostgreSQL 9.2
Date
Msg-id CAKFQuwYkz93H+SQJdikrB-fUN7SZ==tvdspSPSC_6DrvkK-5iQ@mail.gmail.com
Whole thread Raw
In response to DB Size - How much is growing - PostgreSQL 9.2  ("drum.lucas@gmail.com" <drum.lucas@gmail.com>)
List pgsql-admin
On Mon, Apr 18, 2016 at 3:46 PM, drum.lucas@gmail.com <drum.lucas@gmail.com> wrote:
Hi all,

I'm using the following query to get the actual size of my DB:
select t1.datname AS db_name,  
       pg_size_pretty(pg_database_size(t1.datname)) as db_size
from pg_database t1
order by pg_database_size(t1.datname) desc;

However I need to know how big is the database over the last month...
Need to know how much has the DB grown up by month...

I did had a Munin and MRTG graphs but the server went down and we don't have access to it anymore...

Is there any way to me get those data?


​Take a measurement now, wait a month, take another measurement, the extrapolate backwards...​

​There is no way to execute a query within a running PostgreSQL cluster/database and obtain its size at any other time besides that exact moment.

Without access to some past measurement knowing the present size does you little good when it comes to estimating change - you need at least two data points.  If you happen to have a pg_dump from the past and one from now you could use that for extrapolation purposes.

David J.

pgsql-admin by date:

Previous
From: "drum.lucas@gmail.com"
Date:
Subject: DB Size - How much is growing - PostgreSQL 9.2
Next
From: "drum.lucas@gmail.com"
Date:
Subject: Tablespace - PostgreSQL 9.2