Re: updating all records of a table

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: updating all records of a table
Date: 2011-03-04 11:47:48
Message-ID: 20110304114748.GB16012@shinkuro.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 03, 2011 at 08:03:59PM -0700, Gauthier, Dave wrote:
> Hi:
>
> I have to update all the records of a table. I'm worried about what the table will look like in terms of fragmentation when this is finished. Is there some sort of table healing/reorg/rebuild measure I should take if I want the resulting table to operate at optimal efficiency? What about indexes, should I drop/recreate those?

Is it really important that it happen in one transaction?

In the past when I've had to do this on large numbers of rows, I
always tried to do it in batches. You can run vacuums in between
groups, so that the table doesn't get too bloated.

Otherwise, yeah, you're better off to do some of the cleanup Joshua
suggested.

A

--
Andrew Sullivan
ajs(at)crankycanuck(dot)ca

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vibhor Kumar 2011-03-04 11:54:04 Re: updating all records of a table
Previous Message zab08 2011-03-04 10:58:11 full text search