Re: Re: Need help in reclaiming disk space by deleting the selected records

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Yelai, Ramkumar IN BLR STS *EXTERN*" <ramkumar(dot)yelai(at)siemens(dot)com>, <pgsql-general(at)postgresql(dot)org>
Cc: <scrawford(at)pinpointresearch(dot)com>, <andres(at)2ndquadrant(dot)com>
Subject: Re: Re: Need help in reclaiming disk space by deleting the selected records
Date: 2012-09-27 10:39:15
Message-ID: D960CB61B694CF459DCFB4B0128514C20874C1A4@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yelai, Ramkumar wrote:
> 1. Do I need run REINDEX to reduce space or auto vacuum will handle
re indexing?

Autovacuum will not rebuild the index as REINDEX does.
It will only free index entries tht can be reused later.

> 2. Cluster, Re index and Vacuum full locks the table, Hence do we
need to avoid database operations
> ( select, delete, insert ) while doing disk clean up? Just curious
what if I keep inserting while
> running this command?

The INSERT would get blocked until the CLUSTER, REINDEX or VACUUM FULL
is done.

> 3. All the three commands needs some additional space to do this
operation? Am I correct?

Yes.

> 4. Would all database server ( oracle, sqlserver and mysql ) needs
downtime while doing disk clean
> up?

"Disk cleanup" is a very vague term.
All database management systems handle these things differently.

Note that PostgreSQL normally does not need any downtime if the
vacuum strategy is right.

> 5. I am very happy to use Truncate and table partitioning, it is
satisfying my requirements. But in
> order to achieve this, for 10 years ( currently 6 unique archiving
tables I have ) I have to create
> 1440 month tables. Will it creates any issue and is there anything I
need to consider carefully while
> doing this?

Anything exceeding a few hundred partitions is not considered a good
idea.
The system needs to keep track of all the tables, and query planning
for such a partitioned table might be expensive.

1440 is probably pushing the limits, but maybe somebody with more
experience can say more.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matthias 2012-09-27 10:48:24 Re: [GENERAL] Inaccurate Explain Cost
Previous Message Albe Laurenz 2012-09-27 10:21:54 Re: idle in transaction query makes server unresponsive