Thread: Table space grow big - PostgreSQL

Table space grow big - PostgreSQL

From
Khangelani Gama
Date:

Hi all

 

 

Please assist on this scenario, I am a junior DBA, perhaps the question I have is too simple please bear with me.

 

 

I have a server with one PostgreSQL database and the data reside in /usr/local/pgsql/data/ running on Redhat 9 O/S.

 

File system looks as follows:

 

Filesystem            Size  Used Avail Use% Mounted on

/dev/hda3              73G   61G  8.7G  88% /

/dev/hda1              99M   63M   32M  67% /boot

none                  441M     0  441M   0% /dev/shm

 

 

Disc space utilization looks as follows where the data/ directory seems to be taking a lot of space compared to any other directories:

 

From / directory on user root/:

 

Size        directory

4.0K    ./lost+found

58M     ./boot

436K    ./dev

900M    ./proc

1.1G    ./var

263M    ./tmp

25M     ./etc

26M     ./root

57G     ./usr

5.3M    ./bin

2.0G    ./home

4.0K    ./initrd

68M     ./lib

32K     ./mnt

4.0K    ./opt

15M     ./sbin

4.0K    ./misc

4.0K    ./.automount

48K     ./tftpboot

44K     ./backup

211M    ./u

8.0K    ./backups

62G     .                      - Size

 

 

 

/usr/local/pgsql/data/base  directory shows the following where 95186722/ takes a lot of space  :

 

3.6M    ./1

3.6M    ./16975

51G     ./95186722

4.8M    ./4830693

51G     .

 

 

Some files (which are called table space names, please correct me if I am wrong?) listed under 95186722/ directory shows different sizes where the biggest of all is 440M :

 

-rw-------    1 postgres postgres      16K May  5 12:50 219436402

-rw-------    1 postgres postgres      16K May  5 12:50 219436401

-rw-------    1 postgres postgres      16K May  5 12:50 219436400

-rw-------    1 postgres postgres      16K May  5 12:50 219436399

-rw-------    1 postgres postgres      34M May  5 12:50 219436274

-rw-------    1 postgres postgres      42M May  5 12:50 219436273

-rw-------    1 postgres postgres      43M May  5 12:50 219436272

-rw-------    1 postgres postgres      42M May  5 12:50 219436271

-rw-------    1 postgres postgres      34M May  5 12:50 219436270

-rw-------    1 postgres postgres      42M May  5 12:50 219436269

-rw-------    1 postgres postgres      42M May  5 12:50 219436268

-rw-------    1 postgres postgres      51M May  5 12:50 219436267

-rw-------    1 postgres postgres      34M May  5 12:50 219436266

-rw-------    1 postgres postgres      51M May  5 12:50 219436265

-rw-------    1 postgres postgres      15M May  5 12:50 218478745

-rw-------    1 postgres postgres      11M May  5 12:50 218478744

-rw-------    1 postgres postgres      10M May  5 12:50 218478743

-rw-------    1 postgres postgres      13M May  5 12:50 218478742

-rw-------    1 postgres postgres     440M May  5 12:50 216081969.1

 

 

 

Now the dump file of the very same database created by using command : pg_dump –U user –O dbname > /tmp/filename is 2.8G big. :

 

-rw-r--r--  1 root root 2.8G May  5 12:47 db.dump

 

 

 

 

The main question I have is: What makes the /usr/local/pgsql/data/base/95186722/  grow so big while the actual data with its schema is only 2.8G and that is there a way to reduce the table space sizes or anything related to that?

 

 

 

Your response will be truly appreciated

 

 

Thanks

Khangelani Gama

 

 

 

 

 

 

 

 

Confidentiality Notice:http://ucs.co.za/conf.html

 

 



The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries. Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited. If you are not the intended addressee please notify the writer immediately and destroy the e-mail. UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.

Re: Table space grow big - PostgreSQL

From
"Kevin Grittner"
Date:
Khangelani Gama  wrote:

> /usr/local/pgsql/data/base directory shows the following where
> 95186722/ takes a lot of space :

> 51G ./95186722

> Now the dump file of the very same database created by using
> command : pg_dump -U user -O dbname > /tmp/filename is 2.8G big.

> The main question I have is: What makes the
> /usr/local/pgsql/data/base/95186722/ grow so big while the actual
> data with its schema is only 2.8G and that is there a way to reduce
> the table space sizes or anything related to that?

The size of a dump is often somewhat smaller than the raw data, but
this extreme difference suggests that your tables are bloated due to
inadequate routine maintenance.  What version of PostgreSQL is this?
What is your vacuum policy?  Please show the contents of your
postgresql.conf file with all comments stripped.

-Kevin


Re: Table space grow big - PostgreSQL

From
Devrim GÜNDÜZ
Date:
On Wed, 2010-05-05 at 13:36 +0200, Khangelani Gama wrote:
> The main question I have is: What makes
> the /usr/local/pgsql/data/base/95186722/  grow so big while the actual
> data with its schema is only 2.8G and that is there a way to reduce
> the table space sizes or anything related to that?

Which PostgreSQL version is this? I'm assuming it is an old one, since
you are running Red Hat 9.

Have you vacuumed it recently/regularly? If not, dead space (space that
is consumed by dead tuples) will consume lots of disk space, until they
are vacuumed. However, If you haven't vacuumed for a long time, it may
be the best to dump/restore the database, and then apply regular
maintenance:

http://www.postgresql.org/docs/current/static/maintenance.html

Regards,
--
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

Attachment

Re: Table space grow big - PostgreSQL

From
Achilleas Mantzios
Date:
Στις Wednesday 05 May 2010 14:45:26 ο/η Kevin Grittner έγραψε:
> Khangelani Gama  wrote:
>
> > /usr/local/pgsql/data/base directory shows the following where
> > 95186722/ takes a lot of space :
>
> > 51G ./95186722
>
> > Now the dump file of the very same database created by using
> > command : pg_dump -U user -O dbname > /tmp/filename is 2.8G big.
>
> > The main question I have is: What makes the
> > /usr/local/pgsql/data/base/95186722/ grow so big while the actual
> > data with its schema is only 2.8G and that is there a way to reduce
> > the table space sizes or anything related to that?
>
> The size of a dump is often somewhat smaller than the raw data, but
> this extreme difference suggests that your tables are bloated due to
> inadequate routine maintenance.  What version of PostgreSQL is this?
> What is your vacuum policy?  Please show the contents of your
> postgresql.conf file with all comments stripped.
>

It depends, in the case of indexes, one SQL CREATE INDEX statement could result to many megs of memory on disk,
while, on the other hand, binary content (a bytea holding e.g. image bitmaps) will have bigger size in the dump rather
than
on disk's raw data, since it is compressed there.
In our case the dump is twice the size of the db on disk, but generally i think there cant be no universal rule of what
is
larger than what.

> -Kevin
>
>



--
Achilleas Mantzios

Re: Table space grow big - PostgreSQL

From
Brett Parker
Date:
On 05 May 13:36, Khangelani Gama wrote:
> Hi all
>
>
> Please assist on this scenario, I am a junior DBA, perhaps the
> question I have is too simple please bear with me.
>
> I have a server with one PostgreSQL database and the data reside in
> /usr/local/pgsql/data/ running on Redhat 9 O/S.

<snippage class="lots" />

> The main question I have is: What makes the
> /usr/local/pgsql/data/base/95186722/  grow so big while the actual
> data with its schema is only 2.8G and that is there a way to reduce
> the table space sizes or anything related to that?

OK - what version of postgres would be a good starting question...

But, at a guess, I'd say you have a fair amount of table churn, and that
you're probably due running a VACUUM FULL over the database that is
using the most space, it may fail, but if it does it should tell you
what bit of config you'll need to change to make it work.

The other possible usage of lots of space is indexes on the database
tables, these are not included in the dump, and so the size of the dump
doesn't accurately reflect the size of the on disc data.

Hope that gives you somewhere to start from.

Thanks,
--
Brett Parker

Re: Table space grow big - PostgreSQL

From
Khangelani Gama
Date:
Many Thanks for all the replies.


The conversion project to version 8 is still in progress, hence we are still experiencing problems on a version that's
notsupported. That's an honest answer I can give. The thing is it's frustrating to not to have a source of support as
westill have to give support on this version 7.3.4 


There is a script that runs once a month which reindex, vacuum full verborse and vacuum analyze :

Small picture inside the script:

        echo "VACUUMING TABLE ${table} " >>$log 2>>$log
        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "REINDEX TABLE ${table}" >>$log 2>>$log
        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM FULL VERBOSE ${table}" >>$log  2>>$log
        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM ANALYZE ${table}" >>$log  2>>$log


Dumping and restoring the database doesn't decrease the space



There is nothing set in the postgresql.conf file that has to do with vacuum analyze.

If we could have a way to reduce the space in /usr/local/pgsql/data/base/95186722 directory we would be sorted








-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Brett Parker
Sent: Wednesday, May 05, 2010 1:42 PM
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

On 05 May 13:36, Khangelani Gama wrote:
> Hi all
>
>
> Please assist on this scenario, I am a junior DBA, perhaps the
> question I have is too simple please bear with me.
>
> I have a server with one PostgreSQL database and the data reside in
> /usr/local/pgsql/data/ running on Redhat 9 O/S.

<snippage class="lots" />

> The main question I have is: What makes the
> /usr/local/pgsql/data/base/95186722/  grow so big while the actual
> data with its schema is only 2.8G and that is there a way to reduce
> the table space sizes or anything related to that?

OK - what version of postgres would be a good starting question...

But, at a guess, I'd say you have a fair amount of table churn, and that
you're probably due running a VACUUM FULL over the database that is
using the most space, it may fail, but if it does it should tell you
what bit of config you'll need to change to make it work.

The other possible usage of lots of space is indexes on the database
tables, these are not included in the dump, and so the size of the dump
doesn't accurately reflect the size of the on disc data.

Hope that gives you somewhere to start from.

Thanks,
--
Brett Parker

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
informationof UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the
intendedaddressee is prohibited.  If you are not the intended addressee please notify the writer immediately and
destroythe e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for
unauthoriseduse of their e-mail facilities or e-mails sent other than strictly for business purposes. 

Re: Table space grow big - PostgreSQL

From
Iñigo Martinez Lasala
Date:
What about "vacuumdb -azf -U postgres"? (or for each database, "VACUUM FULL")

With that script you only vacuum specific tables, but not entire databases.

vacuum analyze should also be launched more frequently. Perhaps once a day, if possible, or sooner.
"vacuumdb -az -U postgres" (or for each database, "VACUUM ANALYZE"

-----Original Message-----
From: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: [ADMIN] Table space grow big - PostgreSQL
Date: Wed, 5 May 2010 15:42:00 +0200

Many Thanks for all the replies.


The conversion project to version 8 is still in progress, hence we are still experiencing problems on a version that's not supported. That's an honest answer I can give. The thing is it's frustrating to not to have a source of support as we still have to give support on this version 7.3.4


There is a script that runs once a month which reindex, vacuum full verborse and vacuum analyze :

Small picture inside the script:
       echo "VACUUMING TABLE ${table} " >>$log 2>>$log       /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "REINDEX TABLE ${table}" >>$log 2>>$log       /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM FULL VERBOSE ${table}" >>$log  2>>$log       /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM ANALYZE ${table}" >>$log  2>>$log


Dumping and restoring the database doesn't decrease the space



There is nothing set in the postgresql.conf file that has to do with vacuum analyze.

If we could have a way to reduce the space in /usr/local/pgsql/data/base/95186722 directory we would be sorted








-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Brett Parker
Sent: Wednesday, May 05, 2010 1:42 PM
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

On 05 May 13:36, Khangelani Gama wrote:
> Hi all
>
>
> Please assist on this scenario, I am a junior DBA, perhaps the
> question I have is too simple please bear with me.
>
> I have a server with one PostgreSQL database and the data reside in
> /usr/local/pgsql/data/ running on Redhat 9 O/S.

<snippage class="lots" />

> The main question I have is: What makes the
> /usr/local/pgsql/data/base/95186722/  grow so big while the actual
> data with its schema is only 2.8G and that is there a way to reduce
> the table space sizes or anything related to that?

OK - what version of postgres would be a good starting question...

But, at a guess, I'd say you have a fair amount of table churn, and that
you're probably due running a VACUUM FULL over the database that is
using the most space, it may fail, but if it does it should tell you
what bit of config you'll need to change to make it work.

The other possible usage of lots of space is indexes on the database
tables, these are not included in the dump, and so the size of the dump
doesn't accurately reflect the size of the on disc data.

Hope that gives you somewhere to start from.

Thanks,
--
Brett Parker

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.


Re: Table space grow big - PostgreSQL

From
Ian Lea
Date:
In your original email I think you showed a directory that held
something like 50Gb of files with a listing of that directory that
added up to something much smaller.  If that is right - what else is
in that directory?

Does your monthly vacuum script work?


--
Ian.


On Wed, May 5, 2010 at 2:42 PM, Khangelani Gama
<Khangelani.Gama@ucs-software.co.za> wrote:
> Many Thanks for all the replies.
>
>
> The conversion project to version 8 is still in progress, hence we are still experiencing problems on a version
that'snot supported. That's an honest answer I can give. The thing is it's frustrating to not to have a source of
supportas we still have to give support on this version 7.3.4 
>
>
> There is a script that runs once a month which reindex, vacuum full verborse and vacuum analyze :
>
> Small picture inside the script:
>
>        echo "VACUUMING TABLE ${table} " >>$log 2>>$log
>        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "REINDEX TABLE ${table}" >>$log 2>>$log
>        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM FULL VERBOSE ${table}" >>$log  2>>$log
>        /usr/local/pgsql/bin/psql -U $dbuser -h localhost ${db} -tc "VACUUM ANALYZE ${table}" >>$log  2>>$log
>
>
> Dumping and restoring the database doesn't decrease the space
>
>
>
> There is nothing set in the postgresql.conf file that has to do with vacuum analyze.
>
> If we could have a way to reduce the space in /usr/local/pgsql/data/base/95186722 directory we would be sorted
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Brett Parker
> Sent: Wednesday, May 05, 2010 1:42 PM
> To: pgsql-admin@postgresql.org
> Subject: Re: [ADMIN] Table space grow big - PostgreSQL
>
> On 05 May 13:36, Khangelani Gama wrote:
>> Hi all
>>
>>
>> Please assist on this scenario, I am a junior DBA, perhaps the
>> question I have is too simple please bear with me.
>>
>> I have a server with one PostgreSQL database and the data reside in
>> /usr/local/pgsql/data/ running on Redhat 9 O/S.
>
> <snippage class="lots" />
>
>> The main question I have is: What makes the
>> /usr/local/pgsql/data/base/95186722/  grow so big while the actual
>> data with its schema is only 2.8G and that is there a way to reduce
>> the table space sizes or anything related to that?
>
> OK - what version of postgres would be a good starting question...
>
> But, at a guess, I'd say you have a fair amount of table churn, and that
> you're probably due running a VACUUM FULL over the database that is
> using the most space, it may fail, but if it does it should tell you
> what bit of config you'll need to change to make it work.
>
> The other possible usage of lots of space is indexes on the database
> tables, these are not included in the dump, and so the size of the dump
> doesn't accurately reflect the size of the on disc data.
>
> Hope that gives you somewhere to start from.
>
> Thanks,
> --
> Brett Parker
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>
> The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
informationof UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the
intendedaddressee is prohibited.  If you are not the intended addressee please notify the writer immediately and
destroythe e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for
unauthoriseduse of their e-mail facilities or e-mails sent other than strictly for business purposes. 
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

Re: Table space grow big - PostgreSQL

From
"Kevin Grittner"
Date:
Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:

> There is a script that runs once a month

Most likely that should be daily, or at least weekly.

> "REINDEX TABLE ${table}"
> "VACUUM FULL VERBOSE ${table}"
> "VACUUM ANALYZE ${table}"

That's the wrong order.  Try:

"VACUUM FULL VERBOSE ANALYZE ${table}"
"REINDEX TABLE ${table}"

With your current order, the VACUUM FULL bloats the indexes you've
just rebuilt.

If you vacuum frequently enough, you should not need to use the FULL
option.

> Dumping and restoring the database doesn't decrease the space

Now, that's odd.  You're not restoring back into the same database
without dropping it first (using the "clean" option), are you?
Perhaps you have some very wide indexes, or a very large number of
small tables?

> There is nothing set in the postgresql.conf file that has to do
> with vacuum analyze.

Well, that wasn't the only thing I would look for; however, I'm not
sure how many of the things I usually check exist in 7.3 or work the
same way.  :-(

-Kevin

Re: Table space grow big - PostgreSQL

From
Khangelani Gama
Date:
Thanks again for the replies:


Responding to Kevin, Ian, and Inigo:



1. We'll try an change the order in the script
2. Daily vacuum analyze was disabled, which was running from a different script, we'll try to put it back.
3. The monthly script does work.
4. In my original email about the directory that takes more space:

/usr/local/pgsql/data/base directory shows the following where 95186722/ takes a lot of space  :

3.6M    ./1
3.6M    ./16975
51G     ./95186722
4.8M    ./4830693
51G     .



There is nothing else in /usr/local/pgsql/data/base/95186722/  directory except the table space names with different
spacesfor each one of them. And in other servers these table space sizes are now at 1.0G, for an example there is about
15of them which makes about 15G. 

-rw-------    1 postgres postgres      16K May  5 12:50 219436402
-rw-------    1 postgres postgres      16K May  5 12:50 219436401
-rw-------    1 postgres postgres      16K May  5 12:50 219436400
-rw-------    1 postgres postgres      16K May  5 12:50 219436399
-rw-------    1 postgres postgres      34M May  5 12:50 219436274
-rw-------    1 postgres postgres      42M May  5 12:50 219436273
-rw-------    1 postgres postgres      43M May  5 12:50 219436272
-rw-------    1 postgres postgres      42M May  5 12:50 219436271
-rw-------    1 postgres postgres      34M May  5 12:50 219436270
-rw-------    1 postgres postgres      42M May  5 12:50 219436269
-rw-------    1 postgres postgres      42M May  5 12:50 219436268
-rw-------    1 postgres postgres      51M May  5 12:50 219436267
-rw-------    1 postgres postgres      34M May  5 12:50 219436266
-rw-------    1 postgres postgres      51M May  5 12:50 219436265
-rw-------    1 postgres postgres      15M May  5 12:50 218478745
-rw-------    1 postgres postgres      11M May  5 12:50 218478744
-rw-------    1 postgres postgres      10M May  5 12:50 218478743
-rw-------    1 postgres postgres      13M May  5 12:50 218478742
-rw-------    1 postgres postgres     440M May  5 12:50 216081969.1












-----Original Message-----
From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
Sent: Wednesday, May 05, 2010 3:59 PM
To: pgsql-admin@postgresql.org; Khangelani Gama
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:

> There is a script that runs once a month

Most likely that should be daily, or at least weekly.

> "REINDEX TABLE ${table}"
> "VACUUM FULL VERBOSE ${table}"
> "VACUUM ANALYZE ${table}"

That's the wrong order.  Try:

"VACUUM FULL VERBOSE ANALYZE ${table}"
"REINDEX TABLE ${table}"

With your current order, the VACUUM FULL bloats the indexes you've
just rebuilt.

If you vacuum frequently enough, you should not need to use the FULL
option.

> Dumping and restoring the database doesn't decrease the space

Now, that's odd.  You're not restoring back into the same database
without dropping it first (using the "clean" option), are you?
Perhaps you have some very wide indexes, or a very large number of
small tables?

> There is nothing set in the postgresql.conf file that has to do
> with vacuum analyze.

Well, that wasn't the only thing I would look for; however, I'm not
sure how many of the things I usually check exist in 7.3 or work the
same way.  :-(

-Kevin

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
informationof UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the
intendedaddressee is prohibited.  If you are not the intended addressee please notify the writer immediately and
destroythe e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for
unauthoriseduse of their e-mail facilities or e-mails sent other than strictly for business purposes. 

Re: Table space grow big - PostgreSQL

From
Ian Lea
Date:
I'm still confused about the disk space, even more so now that more
servers and figures of 1Gb and 15Gb have joined the party.

Presumably this:

> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .

is the output from some $ du command.  And is this

> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1

the output from some $ ls command on
/usr/local/pgsql/data/base/95186722?  You say there is nothing else in
that directory, but those sizes don't add up to 51Gb so something is
messed up somewhere.

Maybe this is nothing to do with postgres and a reboot and/or fsck of
the disk will fix everything.


--
Ian.


On Thu, May 6, 2010 at 7:33 AM, Khangelani Gama
<Khangelani.Gama@ucs-software.co.za> wrote:
> Thanks again for the replies:
>
>
> Responding to Kevin, Ian, and Inigo:
>
>
>
> 1. We'll try an change the order in the script
> 2. Daily vacuum analyze was disabled, which was running from a different script, we'll try to put it back.
> 3. The monthly script does work.
> 4. In my original email about the directory that takes more space:
>
> /usr/local/pgsql/data/base directory shows the following where 95186722/ takes a lot of space  :
>
> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .
>
>
>
> There is nothing else in /usr/local/pgsql/data/base/95186722/  directory except the table space names with different
spacesfor each one of them. And in other servers these table space sizes are now at 1.0G, for an example there is about
15of them which makes about 15G. 
>
> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1
>
>
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
> Sent: Wednesday, May 05, 2010 3:59 PM
> To: pgsql-admin@postgresql.org; Khangelani Gama
> Subject: Re: [ADMIN] Table space grow big - PostgreSQL
>
> Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:
>
>> There is a script that runs once a month
>
> Most likely that should be daily, or at least weekly.
>
>> "REINDEX TABLE ${table}"
>> "VACUUM FULL VERBOSE ${table}"
>> "VACUUM ANALYZE ${table}"
>
> That's the wrong order.  Try:
>
> "VACUUM FULL VERBOSE ANALYZE ${table}"
> "REINDEX TABLE ${table}"
>
> With your current order, the VACUUM FULL bloats the indexes you've
> just rebuilt.
>
> If you vacuum frequently enough, you should not need to use the FULL
> option.
>
>> Dumping and restoring the database doesn't decrease the space
>
> Now, that's odd.  You're not restoring back into the same database
> without dropping it first (using the "clean" option), are you?
> Perhaps you have some very wide indexes, or a very large number of
> small tables?
>
>> There is nothing set in the postgresql.conf file that has to do
>> with vacuum analyze.
>
> Well, that wasn't the only thing I would look for; however, I'm not
> sure how many of the things I usually check exist in 7.3 or work the
> same way.  :-(
>
> -Kevin
>
> The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
informationof UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the
intendedaddressee is prohibited.  If you are not the intended addressee please notify the writer immediately and
destroythe e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for
unauthoriseduse of their e-mail facilities or e-mails sent other than strictly for business purposes. 
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

Re: Table space grow big - PostgreSQL

From
Khangelani Gama
Date:
An Example from another server where the directory grew so big:


/data/postgres7.3.4/data/base/31057006/ directory shows the following size:

4.0K    ./pgsql_tmp
34G     .


A 34GB, it's those tablespaces with different sizes for each in 31057006/ directory.



We dumped the database using pg_dump, the dump file was 9.8G of size. We installed a brand new disc and then created a
newdatabase name then imported the data from the dump file of 9.8GB size. 

Then I checked the size of /data/postgres7.3.4/data/base/16976/ new directory from the new disc. The size looks as
follows:

4.0K    ./pgsql_tmp
6.0G    .



6.0G is way smaller then the 34G which was in the old disc.


The reboot does work, I am not sure the fsck command could fix the problem.

Note: there is nothing else that is inside the directory that's showing this big sizes.


We need a root cause that grow the size so big in the directory I mentioned.














-----Original Message-----
From: Ian Lea [mailto:ian.lea@gmail.com]
Sent: Thursday, May 06, 2010 10:49 AM
To: Khangelani Gama
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

I'm still confused about the disk space, even more so now that more
servers and figures of 1Gb and 15Gb have joined the party.

Presumably this:

> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .

is the output from some $ du command.  And is this

> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1

the output from some $ ls command on
/usr/local/pgsql/data/base/95186722?  You say there is nothing else in
that directory, but those sizes don't add up to 51Gb so something is
messed up somewhere.

Maybe this is nothing to do with postgres and a reboot and/or fsck of
the disk will fix everything.


--
Ian.


On Thu, May 6, 2010 at 7:33 AM, Khangelani Gama
<Khangelani.Gama@ucs-software.co.za> wrote:
> Thanks again for the replies:
>
>
> Responding to Kevin, Ian, and Inigo:
>
>
>
> 1. We'll try an change the order in the script
> 2. Daily vacuum analyze was disabled, which was running from a different script, we'll try to put it back.
> 3. The monthly script does work.
> 4. In my original email about the directory that takes more space:
>
> /usr/local/pgsql/data/base directory shows the following where 95186722/ takes a lot of space  :
>
> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .
>
>
>
> There is nothing else in /usr/local/pgsql/data/base/95186722/  directory except the table space names with different
spacesfor each one of them. And in other servers these table space sizes are now at 1.0G, for an example there is about
15of them which makes about 15G. 
>
> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1
>
>
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
> Sent: Wednesday, May 05, 2010 3:59 PM
> To: pgsql-admin@postgresql.org; Khangelani Gama
> Subject: Re: [ADMIN] Table space grow big - PostgreSQL
>
> Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:
>
>> There is a script that runs once a month
>
> Most likely that should be daily, or at least weekly.
>
>> "REINDEX TABLE ${table}"
>> "VACUUM FULL VERBOSE ${table}"
>> "VACUUM ANALYZE ${table}"
>
> That's the wrong order.  Try:
>
> "VACUUM FULL VERBOSE ANALYZE ${table}"
> "REINDEX TABLE ${table}"
>
> With your current order, the VACUUM FULL bloats the indexes you've
> just rebuilt.
>
> If you vacuum frequently enough, you should not need to use the FULL
> option.
>
>> Dumping and restoring the database doesn't decrease the space
>
> Now, that's odd.  You're not restoring back into the same database
> without dropping it first (using the "clean" option), are you?
> Perhaps you have some very wide indexes, or a very large number of
> small tables?
>
>> There is nothing set in the postgresql.conf file that has to do
>> with vacuum analyze.
>
> Well, that wasn't the only thing I would look for; however, I'm not
> sure how many of the things I usually check exist in 7.3 or work the
> same way.  :-(
>
> -Kevin
>
> The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
informationof UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the
intendedaddressee is prohibited.  If you are not the intended addressee please notify the writer immediately and
destroythe e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for
unauthoriseduse of their e-mail facilities or e-mails sent other than strictly for business purposes. 
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
informationof UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the
intendedaddressee is prohibited.  If you are not the intended addressee please notify the writer immediately and
destroythe e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for
unauthoriseduse of their e-mail facilities or e-mails sent other than strictly for business purposes. 

Re: Table space grow big - PostgreSQL

From
Khangelani Gama
Date:
Sorry in my previous comments I meant the "reboot does not work or does not make a difference"



-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Khangelani Gama
Sent: Thursday, May 06, 2010 11:28 AM
To: pgsql-admin@postgresql.org
Cc: Ian Lea; Nico Botha
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

An Example from another server where the directory grew so big:


/data/postgres7.3.4/data/base/31057006/ directory shows the following size:

4.0K    ./pgsql_tmp
34G     .


A 34GB, it's those tablespaces with different sizes for each in 31057006/ directory.



We dumped the database using pg_dump, the dump file was 9.8G of size. We installed a brand new disc and then created a
newdatabase name then imported the data from the dump file of 9.8GB size. 

Then I checked the size of /data/postgres7.3.4/data/base/16976/ new directory from the new disc. The size looks as
follows:

4.0K    ./pgsql_tmp
6.0G    .



6.0G is way smaller then the 34G which was in the old disc.


The reboot does work, I am not sure the fsck command could fix the problem.

Note: there is nothing else that is inside the directory that's showing this big sizes.


We need a root cause that grow the size so big in the directory I mentioned.














-----Original Message-----
From: Ian Lea [mailto:ian.lea@gmail.com]
Sent: Thursday, May 06, 2010 10:49 AM
To: Khangelani Gama
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Table space grow big - PostgreSQL

I'm still confused about the disk space, even more so now that more
servers and figures of 1Gb and 15Gb have joined the party.

Presumably this:

> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .

is the output from some $ du command.  And is this

> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1

the output from some $ ls command on
/usr/local/pgsql/data/base/95186722?  You say there is nothing else in
that directory, but those sizes don't add up to 51Gb so something is
messed up somewhere.

Maybe this is nothing to do with postgres and a reboot and/or fsck of
the disk will fix everything.


--
Ian.


On Thu, May 6, 2010 at 7:33 AM, Khangelani Gama
<Khangelani.Gama@ucs-software.co.za> wrote:
> Thanks again for the replies:
>
>
> Responding to Kevin, Ian, and Inigo:
>
>
>
> 1. We'll try an change the order in the script
> 2. Daily vacuum analyze was disabled, which was running from a different script, we'll try to put it back.
> 3. The monthly script does work.
> 4. In my original email about the directory that takes more space:
>
> /usr/local/pgsql/data/base directory shows the following where 95186722/ takes a lot of space  :
>
> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .
>
>
>
> There is nothing else in /usr/local/pgsql/data/base/95186722/  directory except the table space names with different
spacesfor each one of them. And in other servers these table space sizes are now at 1.0G, for an example there is about
15of them which makes about 15G. 
>
> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1
>
>
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
> Sent: Wednesday, May 05, 2010 3:59 PM
> To: pgsql-admin@postgresql.org; Khangelani Gama
> Subject: Re: [ADMIN] Table space grow big - PostgreSQL
>
> Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:
>
>> There is a script that runs once a month
>
> Most likely that should be daily, or at least weekly.
>
>> "REINDEX TABLE ${table}"
>> "VACUUM FULL VERBOSE ${table}"
>> "VACUUM ANALYZE ${table}"
>
> That's the wrong order.  Try:
>
> "VACUUM FULL VERBOSE ANALYZE ${table}"
> "REINDEX TABLE ${table}"
>
> With your current order, the VACUUM FULL bloats the indexes you've
> just rebuilt.
>
> If you vacuum frequently enough, you should not need to use the FULL
> option.
>
>> Dumping and restoring the database doesn't decrease the space
>
> Now, that's odd.  You're not restoring back into the same database
> without dropping it first (using the "clean" option), are you?
> Perhaps you have some very wide indexes, or a very large number of
> small tables?
>
>> There is nothing set in the postgresql.conf file that has to do
>> with vacuum analyze.
>
> Well, that wasn't the only thing I would look for; however, I'm not
> sure how many of the things I usually check exist in 7.3 or work the
> same way.  :-(
>
> -Kevin
>
> The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
informationof UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the
intendedaddressee is prohibited.  If you are not the intended addressee please notify the writer immediately and
destroythe e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for
unauthoriseduse of their e-mail facilities or e-mails sent other than strictly for business purposes. 
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
informationof UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the
intendedaddressee is prohibited.  If you are not the intended addressee please notify the writer immediately and
destroythe e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for
unauthoriseduse of their e-mail facilities or e-mails sent other than strictly for business purposes. 

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
informationof UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the
intendedaddressee is prohibited.  If you are not the intended addressee please notify the writer immediately and
destroythe e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for
unauthoriseduse of their e-mail facilities or e-mails sent other than strictly for business purposes. 

Re: Table space grow big - PostgreSQL

From
Iñigo Martinez Lasala
Date:
I'm agree with ian.
There is something strange with your filesys...

Can you exec an 'ls -la' ? Perhaps somebody has move something else in that folder with hidden name ( with a dot in folder name )
And, of course, a fsck should be advisable. :) 

-----Original Message-----
From: Ian Lea <ian.lea@gmail.com>
To: Khangelani Gama <Khangelani.Gama@ucs-software.co.za>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: [ADMIN] Table space grow big - PostgreSQL
Date: Thu, 6 May 2010 09:49:19 +0100

I'm still confused about the disk space, even more so now that more
servers and figures of 1Gb and 15Gb have joined the party.

Presumably this:

> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .

is the output from some $ du command.  And is this

> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1

the output from some $ ls command on
/usr/local/pgsql/data/base/95186722?  You say there is nothing else in
that directory, but those sizes don't add up to 51Gb so something is
messed up somewhere.

Maybe this is nothing to do with postgres and a reboot and/or fsck of
the disk will fix everything.


--
Ian.


On Thu, May 6, 2010 at 7:33 AM, Khangelani Gama
<Khangelani.Gama@ucs-software.co.za> wrote:
> Thanks again for the replies:
>
>
> Responding to Kevin, Ian, and Inigo:
>
>
>
> 1. We'll try an change the order in the script
> 2. Daily vacuum analyze was disabled, which was running from a different script, we'll try to put it back.
> 3. The monthly script does work.
> 4. In my original email about the directory that takes more space:
>
> /usr/local/pgsql/data/base directory shows the following where 95186722/ takes a lot of space  :
>
> 3.6M    ./1
> 3.6M    ./16975
> 51G     ./95186722
> 4.8M    ./4830693
> 51G     .
>
>
>
> There is nothing else in /usr/local/pgsql/data/base/95186722/  directory except the table space names with different spaces for each one of them. And in other servers these table space sizes are now at 1.0G, for an example there is about 15 of them which makes about 15G.
>
> -rw-------    1 postgres postgres      16K May  5 12:50 219436402
> -rw-------    1 postgres postgres      16K May  5 12:50 219436401
> -rw-------    1 postgres postgres      16K May  5 12:50 219436400
> -rw-------    1 postgres postgres      16K May  5 12:50 219436399
> -rw-------    1 postgres postgres      34M May  5 12:50 219436274
> -rw-------    1 postgres postgres      42M May  5 12:50 219436273
> -rw-------    1 postgres postgres      43M May  5 12:50 219436272
> -rw-------    1 postgres postgres      42M May  5 12:50 219436271
> -rw-------    1 postgres postgres      34M May  5 12:50 219436270
> -rw-------    1 postgres postgres      42M May  5 12:50 219436269
> -rw-------    1 postgres postgres      42M May  5 12:50 219436268
> -rw-------    1 postgres postgres      51M May  5 12:50 219436267
> -rw-------    1 postgres postgres      34M May  5 12:50 219436266
> -rw-------    1 postgres postgres      51M May  5 12:50 219436265
> -rw-------    1 postgres postgres      15M May  5 12:50 218478745
> -rw-------    1 postgres postgres      11M May  5 12:50 218478744
> -rw-------    1 postgres postgres      10M May  5 12:50 218478743
> -rw-------    1 postgres postgres      13M May  5 12:50 218478742
> -rw-------    1 postgres postgres     440M May  5 12:50 216081969.1
>
>
>
>
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
> Sent: Wednesday, May 05, 2010 3:59 PM
> To: pgsql-admin@postgresql.org; Khangelani Gama
> Subject: Re: [ADMIN] Table space grow big - PostgreSQL
>
> Khangelani Gama <Khangelani.Gama@ucs-software.co.za> wrote:
>
>> There is a script that runs once a month
>
> Most likely that should be daily, or at least weekly.
>
>> "REINDEX TABLE ${table}"
>> "VACUUM FULL VERBOSE ${table}"
>> "VACUUM ANALYZE ${table}"
>
> That's the wrong order.  Try:
>
> "VACUUM FULL VERBOSE ANALYZE ${table}"
> "REINDEX TABLE ${table}"
>
> With your current order, the VACUUM FULL bloats the indexes you've
> just rebuilt.
>
> If you vacuum frequently enough, you should not need to use the FULL
> option.
>
>> Dumping and restoring the database doesn't decrease the space
>
> Now, that's odd.  You're not restoring back into the same database
> without dropping it first (using the "clean" option), are you?
> Perhaps you have some very wide indexes, or a very large number of
> small tables?
>
>> There is nothing set in the postgresql.conf file that has to do
>> with vacuum analyze.
>
> Well, that wasn't the only thing I would look for; however, I'm not
> sure how many of the things I usually check exist in 7.3 or work the
> same way.  :-(
>
> -Kevin
>
> The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of UCS Group and/or its subsidiaries.  Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.  If you are not the intended addressee please notify the writer immediately and destroy the e-mail.  UCS Group Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>