I have long time without working on pgsql performance, but you can try materialized views or if you are already using its try apply some performance tips...
This are some link i found in a fast search, but if you solution is going by this way this can be a kickstart to solve your problem..