pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bernhard Schrader <bernhard.schrader@innogames.de>
To: pgsql-admin@postgresql.org
Subject: Big difference in databasesize compared with disksize
Date: Tue, 14 Feb 2012 14:22:32 +0100
Message-ID: <4F3A6018.3000902@innogames.de> (raw)

Hi all,

Problem:
If I use
SELECT pg_size_pretty(pg_database_size('dbname')) As fulldbsize;

  fulldbsize
------------
  6455 MB
(1 row)

If I compare this output with
/var/lib/postgresql/9.0/main/base/[DBFOLDER]
I have a difference of 3 GB, which I think is not normal.

To make a little bit clearer what i mean:

/var/lib/postgresql/9.0/main/base/43169# du --apparent-size -h
6.4G	.

/var/lib/postgresql/9.0/main/base/43169# du -sh
9.4G	.

Is such a big fragmentation a normal behavior? It's splitted to several 
Filenodes.

I also made a "xfs_fsr" to defrag all of this, i gathered around 1 GB 
back ( would be more if the tables wouldn't be written in this time ) 
But within some hours the fragmentation was back..

There is also no big dead tuple count in this database, it's getting a 
vacuum analyze every night.

Right now i am out of ideas... What do you think i could do?
If you need more information i can provide.

Environment:
- OS: Debian Lenny
- Disksize: 15GB
- Filesystem: XFS
- Psql: 9.0.3

thanks in advance.

regards
Bernhard




view thread (3+ messages)  latest in thread

Message-ID: <4F3A6018.3000902@innogames.de>
Permalink:  ../4F3A6018.3000902@innogames.de/
Also on:    postgresql.org/message-id/4F3A6018.3000902@innogames.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: bernhard.schrader@innogames.de
  Subject: Re: Big difference in databasesize compared with disksize
  In-Reply-To: <4F3A6018.3000902@innogames.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox