On Fri, Oct 5, 2012 at 12:46 PM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote: > > FOR c IN SELECT ctid FROM table WHERE ... ORDER BY ... LOOP > DELETE FROM table WHERE ctid = c; > END LOOP; Maybe, in that sense, it would be better to optimize client-server protocol for batch operations. PREPARE blah(c) AS DELETE FROM table WHERE ctid = $1; EXECUTE blah(c1), blah(c2), blah(c3), ... ^ 1 transaction, 1 roundtrip, multiple queries -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance