X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 62D929FA4A7 for ; Fri, 30 Jun 2006 12:09:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 38932-06 for ; Fri, 30 Jun 2006 12:09:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 6A4439FA163 for ; Fri, 30 Jun 2006 12:09:19 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k5UF9EJ7024015; Fri, 30 Jun 2006 11:09:14 -0400 (EDT) To: Warren Little cc: pgsql-admin@postgresql.org Subject: Re: auto vacuum doens't appear to be working In-reply-to: <200606300808.40460.warren.little@meridiascapital.com> References: <200606300808.40460.warren.little@meridiascapital.com> Comments: In-reply-to Warren Little message dated "Fri, 30 Jun 2006 08:08:40 -0600" Date: Fri, 30 Jun 2006 11:09:14 -0400 Message-ID: <24014.1151680154@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/282 X-Sequence-Number: 22244 Warren Little 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