pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@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 00:49:30 -0700
Message-ID: <dcc563d11001062349y54bdbdcbm5d95fc5f08a332a8@mail.gmail.com> (raw)
In-Reply-To: <hi41os$eiv$1@news.hub.org>
References: <hi41os$eiv$1@news.hub.org>

On Thu, Jan 7, 2010 at 12:17 AM, Carlo Stonebanks
<stonec.register@sympatico.ca> wrote:
> Our DB has an audit table which is 500M rows and growing. (FYI the objects
> being audited are grouped semantically, not individual field values).
>
> Recently we wanted to add a new feature and we altered the table to add a
> new column. We are backfilling this varchar(255) column by writing a TCL
> script to page through the rows (where 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.)
>
> We have 10 columns, six of which are indexed. Rough calculations suggest
> that this will take two to three weeks to complete on an 8-core CPU with
> more than enough memory.
>
> As a ballpark estimate - is this sort of performance for an 500M updates
> what one would expect of PG given the table structure (detailed below) or
> should I dig deeper to look for performance issues?

Got an explain analyze of the delete query?



view thread (30+ messages)  latest in thread

Message-ID: <dcc563d11001062349y54bdbdcbm5d95fc5f08a332a8@mail.gmail.com>
Permalink:  ../dcc563d11001062349y54bdbdcbm5d95fc5f08a332a8@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d11001062349y54bdbdcbm5d95fc5f08a332a8@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: scott.marlowe@gmail.com, stonec.register@sympatico.ca
  Subject: Re: Massive table (500M rows) update nightmare
  In-Reply-To: <dcc563d11001062349y54bdbdcbm5d95fc5f08a332a8@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