Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WFg8Y-0000Rk-C0 for pgsql-performance@arkaria.postgresql.org; Tue, 18 Feb 2014 08:34:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WFg8X-0006yC-Me for pgsql-performance@arkaria.postgresql.org; Tue, 18 Feb 2014 08:34:41 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WFg8W-0006y4-D7 for pgsql-performance@postgresql.org; Tue, 18 Feb 2014 08:34:40 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WFg8T-0000oy-Ab for pgsql-performance@postgresql.org; Tue, 18 Feb 2014 08:34:39 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 282F328405; Tue, 18 Feb 2014 00:34:35 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 237E51826B; Tue, 18 Feb 2014 00:34:35 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id AC15D12003A; Tue, 18 Feb 2014 00:34:34 -0800 (PST) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Tue, 18 Feb 2014 00:34:33 -0800 (PST) Message-ID: <53031B18.5060103@vmware.com> Date: Tue, 18 Feb 2014 10:34:32 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: David Wall CC: pgsql-performance@postgresql.org Subject: Re: DB size and TABLE sizes don't seem to add up References: <530289D4.20106@computer.org> In-Reply-To: <530289D4.20106@computer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.5 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 02/18/2014 12:14 AM, David Wall wrote: > I am running PG 9.2.4 and I am trying to figure out why my database size > shows one value, but the sum of my total relation sizes is so much less. > > Basically, I'm told my database is 188MB, but the sum of my total > relation sizes adds up to just 8.7MB, which is 1/20th of the reported > total. Where is the 19/20th of my data then? We do make significant > use of large objects, so I suspect it's in there. Is there a relation > size query that would include the large object data associated with any > OIDs in those tables? You can use "select pg_total_relation_size('pg_largeobject')" to get the total size of the large objects. Attributing large objects to the tables that refer them is more difficult. For a single table, something like this: select sum(pg_column_size(lo.data)) from lotest_stash_values t, pg_largeobject lo where lo.loid = t.loid; Replace "lotest_stash_values" with the table's name and lo.loid with the name of the OID column. - Heikki -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance