Re: wip: functions median and percentile
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Hitoshi Harada <umi.tanuki@gmail.com>,
Robert Haas <robertmhaas@gmail.com>, Greg Stark <gsstark@mit.edu>, Pavel Stehule <pavel.stehule@gmail.com>, David Fetter <david@fetter.org>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-10-11T17:37:11Z
Lists: pgsql-hackers
Dean Rasheed <dean.a.rasheed@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