Re: Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls
Дата
Msg-id CA+TgmobkYBxF+BHXRgayhV6_Q1nxMdUr8f_WdH2w+JN2EXV=WA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-hackers
On Thu, Sep 26, 2013 at 4:20 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> But how do we ensure that the BMS is allocated in a context?  You'd have
> to switch contexts each time you call bms_add_member.  I don't have a
> good answer to this.

The coding of bms_add_member is pretty funky.  Why doesn't it just
repalloc() the input argument if it's not big enough?  If it did that,
the new allocation would be in the same memory context as the original
one, and we'd not need to care about the memory context when adding an
element to an already non-empty set.

But even if we did decide to switch memory contexts on every call, it
would still be much cleaner than this.  It's only three lines of code
(and about as many instructions) to save and restore
CurrentMemoryContext.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Extra functionality to createuser
Следующее
От: Robert Haas
Дата:
Сообщение: Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE