Re: work_mem greater than 2GB issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: wickro <robwickert(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: work_mem greater than 2GB issue
Date: 2009-05-14 18:45:07
Message-ID: 17304.1242326707@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

wickro <robwickert(at)gmail(dot)com> writes:
> So this is a planning mistake? Should a hash be allowed to grow larger
> than work_mem before it starts to use the disk?

HashAggregate doesn't have any ability to spill to disk. The planner
will not select a HashAggregate if it thinks the required hash table
would be larger than work_mem. What you've evidently got here is a
misestimate of the required hash table size, which most likely is
stemming from a bad estimate of the number of groups. How does that
estimate (12617088 here) compare to reality? Have you tried increasing
the statistics target for partner_id and keyword (or the whole table)?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message George Kao 2009-05-14 19:07:02 Re: how to extract data from bytea so it is be used in blob for mysql database
Previous Message Sam Mason 2009-05-14 18:15:12 Re: Question on inserting non-ascii strings