Re: database size much bigger than tablespaces on filesystem

From: Rob Audenaerde <Rob(dot)Audenaerde(at)Valuecare(dot)nl>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: database size much bigger than tablespaces on filesystem
Date: 2011-09-14 15:21:33
Message-ID: 1D020918205F334CBDD5CE7DF2038A2E15A581245A@IE2RD2XVS271.red002.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

>On Wed, 2011-09-14 at 04:03 -0700, Rob Audenaerde wrote:
>> I have a Postgresql 8.3 instance with tablespaces totalling on about 74G. This is fine.
>>
>> But if I ask Postgresql how big my database is, I get a (unexpected) large answer: 595 GB.
>>
>> This seems very strange. Disk I/O tests on the system are in the 'normal' range, but queries are slower than they used to be.
>>
>> Is this corruption of the database? Or are there ways to 'fix' this oddity?
>>
>> Btw:
>>
>> I check the tablespace size by the os:
>>
>> /usr/local/pgsql/data/tblspaces/du -c -h
>> 74G total
>>
>> All tablespaces are there. I check this by the \db command in pgsql
>>
>> I check te database size like this:
>>
>> select pg_size_pretty(pg_database_size('database'))
>> 595 GB

> You should also check the space held in $PGDATA/base.

I did. It is only 320 MB.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2011-09-14 15:47:14 Re: database size much bigger than tablespaces on filesystem
Previous Message Guillaume Lelarge 2011-09-14 12:00:15 Re: database size much bigger than tablespaces on filesystem