Why does my DB size differ between Production and DR? (Postgres 8.4) - Mailing list pgsql-general

From Aleksey Tsalolikhin
Subject Why does my DB size differ between Production and DR? (Postgres 8.4)
Date
Msg-id AANLkTikTdf4BntkH-tKM1uFo0FTjNNSPD3CsR3mMR=k5@mail.gmail.com
Whole thread Raw
Responses Re: Why does my DB size differ between Production and DR? (Postgres 8.4)  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
Situation:  Disk usage on production server root filesystem is at 68%
utilization (80 GB used), on DR is at 51% (56 GB used).   We use
SlonyII-1.2.x to keep the DR up to date.  I would like to account for
the 24 GB difference.


Symptoms:


1. Database size reported by psql c '\l+'

         Production:   52 GB

         DR:               30 GB

         Difference:  22 GB


2. Top table by size (including index and TOAST), as reported by:
SELECT relname as "Table",
pg_size_pretty(pg_total_relation_size(relid)) As "Size" from
pg_catalog.pg_statio_user_tables ORDER BY
pg_total_relation_size(relid) DESC;

         Production:   42 GB

         DR:               24 GB

         Difference:   18 GB

2b. That same table size (no index, no TOAST) as reported by:  SELECT
relname as "Table", pg_size_pretty(pg_relation_size(relid)) As "Size"
from pg_catalog.pg_statio_user_tables ORDER BY pg_relation_size(relid)
DESC;

         Production:   744 MB

         DR:               528 MB


3. Output of "du -sh data" for my PostgreSQL installation:

         Production:   60 GB

         DR:               31 GB

         Difference: 31 GB


How to account for the 18 GB difference in that single table size
between production and DR?  I imagine it's in the TOAST but how do I
list TOAST table size?  How to get production size down closer to that
of the DR?

Best,
-at

pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: Re: Issues with generate_series using integer boundaries
Next
From: Tom Lane
Date:
Subject: Re: Issues with generate_series using integer boundaries