Re: Hash support for grouping sets

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Mark Dilger <hornschnorter(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hash support for grouping sets
Date: 2017-03-15 21:51:55
Message-ID: 8760ja43ko.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Another small update to the patch, this time to eliminate any
possibility of integer overflow when handling extremely large estimated
groupings.

Key change:

- k_weights[i] = (int) floor(sz / scale);
+ /*
+ * If sz is enormous, but work_mem (and hence scale) is
+ * small, avoid integer overflow here.
+ */
+ k_weights[i] = (int) Min(floor(sz / scale),
+ k_capacity + 1.0);

--
Andrew (irc:RhodiumToad)

Attachment Content-Type Size
gshash25.patch text/x-patch 149.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-03-15 22:06:10 Re: WIP: Faster Expression Processing v4
Previous Message Joe Conway 2017-03-15 21:46:23 Re: scram and \password