Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

Next:From: Matthew WakelingDate: 2009-10-28 16:36:52
Subject: Re: Postgresql optimisation
Previous:From: Greg SmithDate: 2009-10-28 16:20:11
Subject: Re: Postgresql optimisation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group