pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Warren Little <warren.little@meridiascapital.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: auto vacuum doens't appear to be working
Date: Fri, 30 Jun 2006 11:09:14 -0400
Message-ID: <24014.1151680154@sss.pgh.pa.us> (raw)
In-Reply-To: <200606300808.40460.warren.little@meridiascapital.com>
References: <200606300808.40460.warren.little@meridiascapital.com>

Warren Little <warren.little@meridiascapital.com> writes:
> when I run 
> SELECT sum( relpages*8/1024 ) as MB FROM pg_class where relname != '' 
> I get a value of 104995 which I interpret to mean I have 104GB of stored data 
> in the database and this value has remained relatively static (+/- 1GB) over 
> the past couple of weeks. 
> We I to a df -h on the filesystem holding the database cluster I get a usage 
> of 140GB.  Again I interpret this to mean I have nearly 35GB of "uncleaned" 
> data.

That conclusion is entirely incorrect --- relpages should be the whole
space usage for each table, assuming it's up-to-date (it might not be).
However a query done as above would account only for the current
database; perhaps the other space is in other databases?  If you've had
database crashes in the past, there could be problems with unreferenced
files.  Or the bloat could be in pg_xlog or one of the other overhead
directories, or not Postgres' fault at all considering that you're
examining the whole filesystem.  A single "df" number won't help you pin
it down, you need to do more careful analysis.  I'd start with a
directory-by-directory "du" listing, and check individual files if
necessary (contrib/oid2name or contrib/pgstattuple might help).  For
background see
http://www.postgresql.org/docs/8.1/static/storage.html
(adjust for your PG version)

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <24014.1151680154@sss.pgh.pa.us>
Permalink:  ../24014.1151680154@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24014.1151680154@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, warren.little@meridiascapital.com
  Subject: Re: auto vacuum doens't appear to be working
  In-Reply-To: <24014.1151680154@sss.pgh.pa.us>
  References: <200606300808.40460.warren.little@meridiascapital.com> <24014.1151680154@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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