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 8A6219FA192 for ; Fri, 30 Jun 2006 15:07:25 -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 89796-06 for ; Fri, 30 Jun 2006 15:07:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id AF9CD9FA0EC for ; Fri, 30 Jun 2006 15:07:13 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 5AABA56437; Fri, 30 Jun 2006 13:07:12 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Fri, 30 Jun 2006 13:07:12 -0500 Date: Fri, 30 Jun 2006 13:07:12 -0500 From: "Jim C. Nasby" To: Tom Lane Cc: Warren Little , pgsql-admin@postgresql.org Subject: Re: auto vacuum doens't appear to be working Message-ID: <20060630180711.GK17241@pervasive.com> References: <200606300808.40460.warren.little@meridiascapital.com> <24014.1151680154@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24014.1151680154@sss.pgh.pa.us> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060630:tgl@sss.pgh.pa.us::FQBf6zZS1Cy3k9HL:00000000000000000000 0000000000000000000000001N1i X-Hashcash: 1:20:060630:warren.little@meridiascapital.com::0C+m0vmxhntSwjTM:0000 0000000000000000000000000KgE X-Hashcash: 1:20:060630:pgsql-admin@postgresql.org::DqecFShARdR0BQzN:00000000000 0000000000000000000000000QPo X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/283 X-Sequence-Number: 22245 Also, remember that a regular vacuum won't actually free any disk space*, it only marks it as re-useable in the table. * OK, technically it will reclaim space from the very end of the table * in certain circumstances, but in reality it's pretty rare for that to * happen. On Fri, Jun 30, 2006 at 11:09:14AM -0400, Tom Lane wrote: > 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq > -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461