in reply to Re^2: PostgreSQL cursors with Perl.
in thread PostgreSQL cursors with Perl.

Although the specifics are probably not worth it now, as you've already moved to a different database, you should _always_ look into tuning your database if you have queries that seem like they're running a bit long.

I don't know enough about your database, so I don't know exactly what might've been going wrong, but I'd probably look at the following: