"Todd A. Cook" <tcook@xxxxxxxxxxxxxxxxxxxxx> writes: > I am consistently running into out-of-memory issues in 8.1.4 running on > RHEL3 and 8.0.5 on RHEL4. The logs show entries like this: > AggContext: -2130714624 total in 271 blocks; 9688 free (269 chunks); -2130724312 used > TupleHashTable: 893902872 total in 119 blocks; 1088688 free (449 chunks); 892814184 used Misestimated hash aggregation, perhaps? What is the query and what does EXPLAIN show for it? What have you got work_mem set to? regards, tom lane