On 22/07/16 13:07, Johan Fredriksson wrote:
> And by the way, I have also tried to upgrade to Postgresql 9.4.8 (the latest version in postgresl.org's own
repository)without improvment.
>
Not sure what repo you are using, but 9.5.3 and 9.6 Beta are the
*actual* latest versions. Now I'm not sure they will actually help your
particular query, but are probably worth a try out!
regards
Mark