Is pgsql_tmp.* used for anything other than sorts? The only thing I see in a
quick review of the sources is hash joins but that shouldn't be relevant.
I've raised sort_mem to 49152 (1k blocks as I understand it) Yet pgsql_tmp
files are still being created. They range in size from 7M up to 34M. I don't
understand why posgres would need a 34M temporary sort space if it has 48M of
sort memory available. The results weren't much different before I raised
sort_mem.
The query being run is of the form INSERT INTO () (SELECT DISTINCT ON...)
Does the insert have the accumulate temporary data somewhere?
Does sort_mem have to be larger than the corresponding pgsql_tmp area that
would be used if postgres runs out of sort_mem?
--
greg