Hello KaiGain-san, On 08/19/2015 03:19 PM, Kohei KaiGai wrote:
Unless we have no fail-safe mechanism when planner estimated too large number of tuples than actual needs, a strange estimation will consume massive amount of RAMs. It's a bad side effect. My previous patch didn't pay attention to the scenario, so needs to revise the patch.
I agree we need to put a few more safeguards there (e.g. make sure we don't overflow INT when counting the buckets, which may happen with the amounts of work_mem we'll see in the wild soon).
But I think we should not do any extensive changes to how we size the hashtable - that's not something we should do in a bugfix I think.
regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers