From: Mark Roberts <mailing_lists@pandapocket.com>
To: Miernik <public@public.miernik.name>
Cc: pgsql-performance@postgresql.org
Subject: Re: Database size Vs performance degradation
Date: Wed, 30 Jul 2008 15:14:19 -0700
Message-ID: <1217456059.6288.52.camel@localhost> (raw)
In-Reply-To: <20080730215834.5323.0.NOFFLE@turbacz.local>
References: <35FABCF85D99464FB00BC5123DC2A70A051D0FB8@s228130hz1ew09.apptix-01.savvis.net>
<276541.4189.qm@web25805.mail.ukl.yahoo.com>
<20080730215834.5323.0.NOFFLE@turbacz.local>
On Wed, 2008-07-30 at 23:58 +0200, Miernik wrote:
> I have a similar, but different situation, where I TRUNCATE a table
> with
> 60k rows every hour, and refill it with new rows. Would it be better
> (concerning bloat) to just DROP the table every hour, and recreate it,
> then to TRUNCATE it? Or does TRUNCATE take care of the boat as good as
> a
> DROP and CREATE?
>
> I am running 8.3.3 in a 48 MB RAM Xen, so performance matters much.
I've successfully used truncate for this purpose (server 8.2.6):
-----------------------------
psql=> select pg_relation_size(oid) from pg_class where relname =
'asdf';
pg_relation_size
------------------
32768
(1 row)
Time: 0.597 ms
psql=> truncate asdf;
TRUNCATE TABLE
Time: 1.069 ms
psql=> select pg_relation_size(oid) from pg_class where relname =
'asdf';
pg_relation_size
------------------
0
(1 row)
-Mark
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-performance@postgresql.org
Cc: mailing_lists@pandapocket.com, public@public.miernik.name
Subject: Re: Database size Vs performance degradation
In-Reply-To: <1217456059.6288.52.camel@localhost>
* 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