Sean Shanny <shannyconsulting@earthlink.net> writes:
> sort_mem = 64000 # min 64, size in KB
You might want to lower that; a complex query could easily use several
times sort_mem. Whether this is the immediate source of your problem
with the other query is hard to tell.
> vacuum_mem = 32767 # min 1024, size in KB
That seems all right, but I recollect now that it only applies to plain
VACUUM not VACUUM FULL. VACUUM FULL needs to keep track of *all* the
free space in a table, and so it's certainly possible that vacuuming a
huge table with many dead tuples could require lots of memory. I can't
recall anyone else ever complaining about VACUUM FULL running out of
memory, though, so there may be some other contributing factor in your
situation. Too bad you reloaded the table --- it would be interesting
to see if increasing your 512Mb datasize ulimit would have allowed the
VACUUM FULL to complete. (Not but what it would've taken forever :-()
regards, tom lane