Ivan Sergio Borgonovo <mail@webthatworks.it> writes:
> Any suggestion about how to track down the problem?
What you are describing sounds rather like a use-of-uninitialized-memory
problem, wherein the behavior depends on what happened to be in that
memory previously. If so, using a debug/cassert-enabled build of
Postgres might help to make the behavior more reproducible.
(Of course, if the result is that it's reproducibly fast, this doesn't
get us much closer to solving the problem :-(. But it seems worth
trying.)
regards, tom lane