Dean Rasheed <dean.a.rash...@gmail.com> writes: > The estimate of 200 x 8K is below work_mem, so it uses a hash > aggregate. In reality, each tuplesort allocates around 30K initially, > so it very quickly uses over 1GB. A better estimate for the aggregate > wouldn't improve this situation much.
Sure it would: an estimate of 30K would keep the planner from using hash aggregation. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers