pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: marcin mank <marcin.mank@gmail.com>
To: Carlo Stonebanks <stonec.register@sympatico.ca>
Cc: pgsql-performance@postgresql.org
Subject: Re: Massive table (500M rows) update nightmare
Date: Thu, 7 Jan 2010 22:05:14 +0100
Message-ID: <b1b9fac61001071305vf182f3ajff6827f92c943c68@mail.gmail.com> (raw)
In-Reply-To: <hi41os$eiv$1@news.hub.org>
References: <hi41os$eiv$1@news.hub.org>

> every update is a UPDATE ... WHERE id
>>= x AND id < x+10 and a commit is performed after every 1000 updates
> statement, i.e. every 10000 rows.

What is the rationale behind this? How about doing 10k rows in 1
update, and committing every time?

You could try making the condition on the ctid column, to not have to
use the index on ID, and process the rows in physical order. First
make sure that newly inserted production data has the correct value in
the new column, and add 'where new_column is null' to the conditions.
But I have never tried this, use at Your own risk.

Greetings
Marcin Mank



view thread (30+ messages)  latest in thread

Message-ID: <b1b9fac61001071305vf182f3ajff6827f92c943c68@mail.gmail.com>
Permalink:  ../b1b9fac61001071305vf182f3ajff6827f92c943c68@mail.gmail.com/
Also on:    postgresql.org/message-id/b1b9fac61001071305vf182f3ajff6827f92c943c68@mail.gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: marcin.mank@gmail.com, stonec.register@sympatico.ca
  Subject: Re: Massive table (500M rows) update nightmare
  In-Reply-To: <b1b9fac61001071305vf182f3ajff6827f92c943c68@mail.gmail.com>
  References: <hi41os$eiv$1@news.hub.org> <b1b9fac61001071305vf182f3ajff6827f92c943c68@mail.gmail.com>

* 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