in reply to same query, different execution, different performance
I recommend turning on full logging in PostgreSQL to see if there is a difference in the actual SQL being passed to the server and then run EXPLAIN on the statements if they are different.
Celebrate Intellectual Diversity
In Section
Seekers of Perl Wisdom