http://www.perlmonks.org?node_id=1081262


in reply to Help on selecting and deleting many records in a DB.

Doing the work in the database is almost always faster. Did you try running postgresql's EXPLAIN on your query?

Do you have enough indexes on your table?