Edoardo Innocenti <edoardo.innocenti@savinodelbene.com> writes:
Query Plan:<br>
"HashAggregate (cost=4910.06..4910.19 rows=1 width=659)"
Hm ... the planner seems to think that this is a small query that isn't
going to take long, which is a bit at odds with the fact that you're
running out of memory. I suspect that these rowcount estimates are
far too low, which would suggest that you need to make sure your
ANALYZE statistics are up-to-date, and perhaps raise the statistics
targets. Try to get the plan's estimated rowcounts to approximate
reality.
We have pg_autovacuum enable and we launch vacuumdb -z every weeks.