pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Sean Chen <zyschen@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: vacuum performance on insert
Date: Thu, 05 Aug 2010 14:11:08 -0400
Message-ID: <26788.1281031868@sss.pgh.pa.us> (raw)
In-Reply-To: <4C5AB5140200002500034276@gw.wicourts.gov>
References: <AANLkTikS-=gAKhEDbQi+xHp7C6SJjcjHcDaaLm1u-BAT@mail.gmail.com>
	<4C5AB5140200002500034276@gw.wicourts.gov>

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Sean Chen <zyschen@gmail.com> wrote:
>> 1, delete records ...
>> 2, insert records ...
>> 
>> if I add "vacuum analyze" in-between this two steps, will it help
>> on the performance on the insert?
 
> Assuming there are no long-running transactions which would still be
> able to see the deleted rows, a VACUUM between those statements
> would allow the INSERT to re-use the space previously occupied by
> the deleted rows, rather than possibly needing to allocate new space
> from the OS.

But on the other side of the coin, the ANALYZE step is probably not very
helpful there.  Better to do that after you've loaded the new data.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <26788.1281031868@sss.pgh.pa.us>
Permalink:  ../26788.1281031868@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26788.1281031868@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, Kevin.Grittner@wicourts.gov, zyschen@gmail.com
  Subject: Re: vacuum performance on insert
  In-Reply-To: <26788.1281031868@sss.pgh.pa.us>

* 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