Re: Deleting orphaned records (not exists is very slow)

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Tim Uckun <timuckun(at)gmail(dot)com>
Cc: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Deleting orphaned records (not exists is very slow)
Date: 2010-09-28 02:48:56
Message-ID: B8A8CFF6-BEB5-444E-A2B1-18A8DDF0A325@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Sep 27, 2010, at 22:08 , Tim Uckun wrote:

> update to_be_deleted set mark = true where ctid = any (array( select
> ctid from to_be_deleted limit 10));

Why are you messing with ctid? Does the table have no key? If not, you should fix that first.

Michael Glaesemann
grzm seespotcode net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message novnovice 2010-09-28 03:08:00 Merge replication with Postgresql on Windows?
Previous Message Tom Lane 2010-09-28 02:39:33 Re: Killing "stuck" queries and preventing queries from getting "stuck"