Slow delete - Mailing list pgsql-general

From Doug Hall
Subject Slow delete
Date
Msg-id b159536fed69b369c938d44e414f6321@gmail.com
Whole thread Raw
Responses Re: Slow delete
List 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


pgsql-general by date:

Previous
From: Bob
Date:
Subject: Re: Client-Server Example
Next
From: Alvaro Herrera
Date:
Subject: Re: chosing a database name