Search Postgresql Archives

Re: Chunk Delete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/15/07, Abraham, Danny <danny_abraham@xxxxxxx> 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.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux