Search Postgresql Archives

How to copy Datum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 (tempTransValue), and I need to copy tempTransValue to the original window aggregation’s transition value(transValue).

 

I used the function datumCopy as following:

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

 

But when the copied transValue is passed to the invoke function, here is int4_avg_accum, the ArrayType returned from PG_GETARG_ARRAYTYPE_P(0) is null.

Which means the copy action is failed.

 

Anybody know why? Or give me some suggestions? Thanks very much.

 

 

Best Regards

Chaoyong Wang


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux