Re: Postgresql optimisation - Mailing list pgsql-performance

From Dave Dutcher
Subject Re: Postgresql optimisation
Date
Msg-id D7EDFF73B48B43A6833B06DDE3D9C5E3@tridecap.com
Whole thread Raw
In response to Postgresql optimisation  (Denis BUCHER <dbucherml@hsolutions.ch>)
Responses Re: Postgresql optimisation  (Matthew Wakeling <matthew@flymine.org>)
List 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




pgsql-performance by date:

Previous
From: Greg Smith
Date:
Subject: Re: Postgresql optimisation
Next
From: Matthew Wakeling
Date:
Subject: Re: Postgresql optimisation