Re: Chunk Delete - Mailing list pgsql-general

From Alexander Staubo
Subject Re: Chunk Delete
Date
Msg-id 88daf38c0711150546r11ca2e5exce6dbead5dacdcbc@mail.gmail.com
Whole thread Raw
In response to Re: Chunk Delete  ("Abraham, Danny" <danny_abraham@bmc.com>)
Responses Re: Chunk Delete  (Sam Mason <sam@samason.me.uk>)
Re: Chunk Delete  ("Abraham, Danny" <danny_abraham@bmc.com>)
List pgsql-general
On 11/15/07, Abraham, Danny <danny_abraham@bmc.com> wrote:
> With Oracle we do it with: delete ,tname>   where  <cond> and rownum < Y;

You could create a temporary sequence:

  create temporary sequence foo_seq;
  delete from foos where nextval('foo_seq') < 50000;

I'm not sure how fast nextval() is, even on temporary sequences; but
it should be reasonably fast.

If it's a FIFO queue, the table surely has some explicit order through
a column which you will need as part of the query?

Alexander.

pgsql-general by date:

Previous
From: "Abraham, Danny"
Date:
Subject: Chunk Delete
Next
From: Sam Mason
Date:
Subject: Re: Chunk Delete