Re: Savepoints in transactions for speed?

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Claudio Freire <klaussfreire(at)gmail(dot)com>
Cc: Mike Blackwell <mike(dot)blackwell(at)rrd(dot)com>, postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Savepoints in transactions for speed?
Date: 2012-11-29 18:32:22
Message-ID: 1354213942.10198.208.camel@jdavis-laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, 2012-11-29 at 00:48 -0300, Claudio Freire wrote:
> Not really that fast if you have indices (and who doesn't have a PK or two).
>
> I've never been able to update (update) 2M rows in one transaction in
> reasonable times (read: less than several hours) without dropping
> indices. Doing it in batches is way faster if you can't drop the
> indices, and if you can leverage HOT updates.

I tried a quick test with 2M tuples and 3 indexes over int8, numeric,
and text (generated data). There was also an unindexed bytea column.
Using my laptop, a full update of the int8 column (which is indexed,
forcing cold updates) took less than 4 minutes.

I'm sure there are other issues with real-world workloads, and I know
that it's wasteful compared to something that can make use of HOT
updates. But unless there is something I'm missing, it's not really
worth the effort to batch if that is the size of the update.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Claudio Freire 2012-11-29 19:58:06 Re: Savepoints in transactions for speed?
Previous Message Mike Blackwell 2012-11-29 18:14:20 Re: Savepoints in transactions for speed?