Re: Need suggestion on how best to update 3 million rows

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Need suggestion on how best to update 3 million rows
Date: 2007-09-06 15:29:56
Message-ID: 20070906152956.GD8709@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Lincoln Yeoh wrote:
> At 06:32 PM 9/6/2007, Richard Huxton wrote:
>
>> Two other tips for bulk-updates like this:
>> 1. Do as many columns in one go as you can
>> 2. Only update rows that need updating
>>
>> When you've finished, a CLUSTER/VACUUM FULL can be useful too.
>
> How about: make sure you have enough free space because the table will
> effectively double in size? Assuming it hasn't already been updated a few
> times without vacuuming :).

It is true for CLUSTER, but not for VACUUM FULL.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message TJ O'Donnell 2007-09-06 15:43:54 a provocative question?
Previous Message Alvaro Herrera 2007-09-06 15:27:41 Re: Alias "all fields"?