Search Postgresql Archives

Slow delete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux