Re: Bulk processing & deletion

From: Alexander Pyhalov <alp(at)rsu(dot)ru>
To: Ivan Voras <ivoras(at)freebsd(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Bulk processing & deletion
Date: 2011-10-13 13:33:06
Message-ID: 4E96E892.6020000@rsu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/13/2011 16:20, Ivan Voras wrote:
> Hello,
>
> I have a table with a large number of records (millions), on which the
> following should be performed:
>
> 1. Retrieve a set of records by a SELECT query with a WHERE condition
> 2. Process these in the application
> 3. Delete them from the table
>
Hello.
Maybe you can just do begin; delete from ..... WHERE ... RETURNING *;,
process records and issue COMMIT after processing?

--
Best regards,
Alexander Pyhalov,
system administrator of Computer Center of Southern Federal University

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Farber 2011-10-13 13:41:56 Slow query: select * order by XXX desc offset 10 limit 10
Previous Message Vishnu S. 2011-10-13 12:55:09 Tablespace files deleted during continuous run