in reply to DBI execute is slow?

What driver are you using? DBD::Pg is the one to use.

Do you have an index on object.accountid ?

Have you run vacuum / autovacuum ?

Have you run analyze object? (do this after the create index)

How much is a "lot of data"?

versions, please?