On Sunday, March 31, 2013, Tom Lane wrote: > > A different line of thought is that you might have set work_mem to > an unreasonably large value --- the sort step will happily try to > consume work_mem worth of memory. >
I don't think that that can be the problem here, because memtuples can never be more than 1GB even if work_mem is much larger than that. Even if his sort is using pass-by-reference (I don't think it would be), they should be skinny enough that that limitation should prevent it from blowing out memory. Cheers, Jeff