Re: Postgresql optimisation

From: "Dave Dutcher" <dave(at)tridecap(dot)com>
To: "'Denis BUCHER'" <dbucherml(at)hsolutions(dot)ch>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Postgresql optimisation
Date: 2009-10-28 16:30:39
Message-ID: D7EDFF73B48B43A6833B06DDE3D9C5E3@tridecap.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> -----Original Message-----
> From: Denis BUCHER
>
> And each morning huge tables are DELETED and all data is
> INSERTed new from a script. (Well, "huge" is very relative,
> it's only 400'000 records)

If you are deleting ALL rows in the tables, then I would suggest using
TRUNCATE instead of DELETE. Truncate will be faster deleting and it will
not accumulate dead tuples.

Also if you switch to truncate then you should ANALYSE the tables after you
finish inserting. Note that VACUUM ANALYSE is not necessary after a
truncate/insert because there should be no dead tuples to vacuum.

Dave

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Matthew Wakeling 2009-10-28 16:36:52 Re: Postgresql optimisation
Previous Message Greg Smith 2009-10-28 16:20:11 Re: Postgresql optimisation