Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 5F511B5DBE4 for ; Tue, 19 Jul 2011 18:26:59 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 53815-05 for ; Tue, 19 Jul 2011 21:26:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id D03EAB5DBDC for ; Tue, 19 Jul 2011 18:26:52 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p6JLQo8l005037; Tue, 19 Jul 2011 17:26:50 -0400 (EDT) To: Ken Caruso cc: pgsql-admin@postgresql.org Subject: Re: Bloat and Slow Vacuum Time on Toast In-reply-to: References: Comments: In-reply-to Ken Caruso message dated "Tue, 19 Jul 2011 13:37:47 -0700" Date: Tue, 19 Jul 2011 17:26:50 -0400 Message-ID: <5036.1311110810@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.035 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.135 X-Spam-Level: X-Archive-Number: 201107/139 X-Sequence-Number: 37918 Ken Caruso writes: > I am trying to trouble shoot a couple of issue related to vacuum and db > size. I currently have a postgres DB that is around 390GB on disk (du -hs in > $PG_DATA/base). If I look at the total relation size using the following > query: > SELECT SUM(pg_relation_size(pg_class.oid)) > FROM pg_class ; > This says the total size is around 191GB. That query should sum all of the > tables, toast and indexes AFAIK. What PG version? If it's a version with multiple table forks, you're only counting the main forks, not FSM or VM. Theoretically the latter two should be pretty small relative to the main fork, but obviously you are missing something with this query ... regards, tom lane