Re: Spilling hashed SetOps and aggregates to disk

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Spilling hashed SetOps and aggregates to disk
Дата
Msg-id CAKJS1f-CKFnz==fWFZ+z7dqbyH7hStEbjPVpL2QbtKNHCJdt_w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Spilling hashed SetOps and aggregates to disk  (Andres Freund <andres@anarazel.de>)
Ответы Re: Spilling hashed SetOps and aggregates to disk  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On 6 June 2018 at 00:57, Andres Freund <andres@anarazel.de> wrote:
> On 2018-06-06 00:53:42 +1200, David Rowley wrote:
>> On 6 June 2018 at 00:45, Andres Freund <andres@anarazel.de> wrote:
>> > On 2018-06-05 09:35:13 +0200, Tomas Vondra wrote:
>> >> I wonder if an aggregate might use a custom context
>> >> internally (I don't recall anything like that). The accounting capability
>> >> seems potentially useful for other places, and those might not use AllocSet
>> >> (or at least not directly).
>> >
>> > Yea, that seems like a big issue.
>>
>> Unfortunately, at least one of the built-in ones do. See initArrayResultArr.
>
> I think it's ok to only handle this gracefully if serialization is
> supported.
>
> But I think my proposal to continue use a hashtable for the already
> known groups, and sorting for additional groups would largely address
> that largely, right?  We couldn't deal with groups becoming too large,
> but easily with the number of groups becoming too large.

My concern is that only accounting memory for the group and not the
state is only solving half the problem. It might be fine for
aggregates that don't stray far from their aggtransspace, but for the
other ones, we could still see OOM.

If solving the problem completely is too hard, then a half fix (maybe
3/4) is better than nothing, but if we can get a design for a full fix
before too much work is done, then isn't that better?


-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] Moving relation extension locks out of heavyweightlock manager
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: commitfest 2018-07