Re: Delete/update with limit

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, Marco Colombo <pgsql(at)esiway(dot)net>, Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Delete/update with limit
Date: 2007-07-25 08:29:54
Message-ID: 1185352194.8615.53.camel@coppola.muc.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2007-07-24 at 19:06, Stephan Szabo wrote:
> > Unfortunately I don't think this will work. Multiple backends will happily
> > pick up the same ctid in their selects and then try to delete the same
> > records.
>
> I'm pretty sure he said that the batch processing (and the delete) would
> only be happening from one backend at a time, no concurrency on that
> portion, merely concurrency with the large volume of inserts.

Yes it's exactly like that... only it also happened accidentally that 2
batch processes started at the same time, and they should not double
process the data, nor loose some of it. The above scheme is OK with that
too... but the array version from Tom is even better :-)

Regarding the proposed mark/process/delete version, we've done it that
way, and we always managed to get some corner case which lost us data...
so even if it's possible to do it well, it's definitely not easy. The
delete/copy/process private data version is much safer, and it actually
can be done in one transaction to assure crash safety.

Cheers,
Csaba.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2007-07-25 09:22:07 Re: invalid memory alloc request size 2147483648 using toode LIKE 'ä%'
Previous Message Gregory Stark 2007-07-25 08:09:05 Re: a few questions (and doubts) about xid