Slow delete

From: Doug Hall <doughalldev(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Slow delete
Date: 2005-07-13 16:42:06
Message-ID: b159536fed69b369c938d44e414f6321@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sorry. I realize this is a rather newbie question, but I've got a slow
delete going on here, and I could use some help figuring out why. This
is the classic "get rid of orphans" select.

delete from citizen where id not in (select citizenid from
citizen_stage);

citizen.id and citizen_stage.citizenid are both indexed.

The explain select tells me that there is a sequential select of
citizen_stage records. (??) There are 75009 citizen records and 14778
records, and it's taking more than half an hour. How can I speed this
up?

Thanks,
Doug

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2005-07-13 16:53:15 Re: chosing a database name
Previous Message Bob 2005-07-13 16:20:33 Re: Client-Server Example