Re: vacuum performance on insert

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: "Sean Chen" <zyschen(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: vacuum performance on insert
Date: 2010-08-05 18:11:08
Message-ID: 26788.1281031868@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> Sean Chen <zyschen(at)gmail(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kenneth Cox 2010-08-05 18:28:08 Advice configuring ServeRAID 8k for performance
Previous Message Kevin Grittner 2010-08-05 17:56:52 Re: vacuum performance on insert