Re: Delete/update with limit

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Csaba Nagy <nagy(at)ecircle-ag(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-24 17:06:31
Message-ID: 20070724100156.Q47050@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Tue, 24 Jul 2007, Gregory Stark wrote:

> "Csaba Nagy" <nagy(at)ecircle-ag(dot)com> writes:
>
> >> Unfortunately the stuff that makes a ctid=<value> nice doesn't seem to be
> >> used when you're doing an in. It's possible that a function that does
> >> something like
> >> for rec in select ctid from my_table limit 10 loop
> >> delete from my_table where ctid=rec.ctid;
> >> end loop
> >> might do okay, but I haven't tried it.
> >
> > OK, I think this will work. It would be nice though to have the 'ctid
> > in' trick work just as well as 'ctid = ' ...
>
> 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-07-24 17:23:09 Re: varchar does not work too well with IS NOT NULL partial indexes.
Previous Message Gregory Stark 2007-07-24 17:00:22 Re: Delete/update with limit