Re: [HACKERS] problem when optimizing the window aggregation

2012-08-21 Thread Wang, Chaoyong
日 9:47 To: Wang, Chaoyong Cc: pgsql-hackers@postgresql.org Subject: Re: [HACKERS] problem when optimizing the window aggregation "Wang, Chaoyong" writes: > I used the function datumCopy as following: > peraggstate->transValue = datumCopy(peraggstate->tempTransValue, >

Re: [HACKERS] problem when optimizing the window aggregation

2012-08-21 Thread Tom Lane
"Wang, Chaoyong" 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 va

[HACKERS] problem when optimizing the window aggregation

2012-08-21 Thread Wang, Chaoyong
Hi, I'm trying to reduce the re-computing of window aggregation. Here the AVG function for example. The original window aggregation's transition value(transValue) of AVG is an ArrayType, that contains two main values(sum, count). Now, I'm using a temporary transition value (tempTransVa