Andreas Joseph Krogh <andreas@visena.com> wrote:
> Some-times it performs much better (but still not good)
As has already been suggested, that difference is almost certainly
due to differences in how much of the necessary data is cached or
what the query is competing with.
> Does anyone see anything obvious or have any hints what to
> investigate further?
We need more information to be able to say much. Please review
this page:
http://wiki.postgresql.org/wiki/SlowQueryQuestions
Knowing more about the hardware and the tables (including all
indexes) would help a lot, as well as all non-default configuration
settings. In particular, I'm curious whether there is an index on
the message_id column of origo_email_delivery.
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company