Re: "Healing" a table after massive updates

From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: "Healing" a table after massive updates
Date: 2008-09-11 17:15:28
Message-ID: 200809111015.28612@hal.medialogik.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 11 September 2008, "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
wrote:
> I have a job that loads a large table, but then has to "update" about
> half the records for various reasons. My perception of what happens on
> update for a particular recors is...
>
> - a new record will be inserted with the updated value(s).
>
> - The old record is marked as being obselete.
>

What you might consider doing is loading the data into a temp table,
updating it there, then copying that data into the final destination.
Depending on the indexes involved, you might even find this to be faster.

--
Alan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-09-11 18:55:16 Re: "Healing" a table after massive updates
Previous Message Adrian Klaver 2008-09-11 17:10:42 Re: psql scripting tutorials