Re: problem when optimizing the window aggregation

Поиск
Список
Период
Сортировка
От Wang, Chaoyong
Тема Re: problem when optimizing the window aggregation
Дата
Msg-id 95FA8B25DB5E2D4E889EB9BEB6A6406F3CAE78@CORPUSMX30B.corp.emc.com
обсуждение исходный текст
Ответ на Re: problem when optimizing the window aggregation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Thanks again, the reason is found.

The following statement frees all the context for aggregation, including the transValue and tempTransValue:
MemoryContextResetAndDeleteChildren(winstate->aggcontext);


-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
Sent: 2012年8月22日 9:47
To: Wang, Chaoyong
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] problem when optimizing the window aggregation

"Wang, Chaoyong" <Chaoyong.Wang@emc.com> writes:
> I used the function datumCopy as following:

> peraggstate->transValue = datumCopy(peraggstate->tempTransValue,
> peraggstate->transtypeByVal, peraggstate->transtypeLen);

You need to guard that with an is-null check, because datumCopy isn't
designed to cope with null values.  (Which is historical, I guess, but
we're not likely to change it now.)  If you look around you will find
plenty of examples of this coding pattern.
        regards, tom lane




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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: multi-master pgbench?
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [WIP] Performance Improvement by reducing WAL for Update Operation