pgsql: In a non-hashed Agg node, reset the "aggcontext" at group

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: In a non-hashed Agg node, reset the "aggcontext" at group
Дата
Msg-id 20090723204527.E41A675331E@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
In a non-hashed Agg node, reset the "aggcontext" at group boundaries, instead
of individually pfree'ing pass-by-reference transition values.  This should
be at least as fast as the prior coding, and it has the major advantage of
clearing out any working data an aggregate function may have stored in or
underneath the aggcontext.  This avoids memory leakage when an aggregate
such as array_agg() is used in GROUP BY mode.  Per report from Chris Spotts.

Back-patch to 8.4.  In principle the problem could arise in prior versions,
but since they didn't have array_agg the issue seems not critical.

Modified Files:
--------------
    pgsql/src/backend/executor:
        nodeAgg.c (r1.167 -> r1.168)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeAgg.c?r1=1.167&r2=1.168)
    pgsql/src/backend/utils/adt:
        array_userfuncs.c (r1.31 -> r1.32)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/array_userfuncs.c?r1=1.31&r2=1.32)

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

Предыдущее
От: andrewsn@pgfoundry.org (User Andrewsn)
Дата:
Сообщение: hstore-new - hstore-new: fix leakage of wasted space on concatenation
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: In a non-hashed Agg node, reset the "aggcontext" at group