Lists: | pgsql-cluster-hackers |
---|
From: | "Wang, Chaoyong" <Chaoyong(dot)Wang(at)emc(dot)com> |
---|---|
To: | <pgsql-cluster-hackers(at)postgresql(dot)org> |
Subject: | How to copy Datum |
Date: | 2012-08-21 10:40:41 |
Message-ID: | 95FA8B25DB5E2D4E889EB9BEB6A6406F3CACC7@CORPUSMX30B.corp.emc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-cluster-hackers |
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
From: | Nicolas Barbier <nicolas(dot)barbier(at)gmail(dot)com> |
---|---|
To: | "Wang, Chaoyong" <Chaoyong(dot)Wang(at)emc(dot)com> |
Cc: | pgsql-cluster-hackers(at)postgresql(dot)org |
Subject: | Re: How to copy Datum |
Date: | 2012-08-22 09:29:42 |
Message-ID: | CAP-rdTaL=uECCGSug9rZ7bxvGNwRQMZzk_G26twr6WqAMaTZrw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-cluster-hackers |
2012/8/21 Wang, Chaoyong <Chaoyong(dot)Wang(at)emc(dot)com>:
[..]
> 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.
I suggest you ask this question on -hackers instead of here on
-cluster-hackers, as it doesn’t seem to have anything to do with
clustering.
Nicolas
--
A. Because it breaks the logical sequence of discussion.
Q. Why is top posting bad?
From: | "Wang, Chaoyong" <Chaoyong(dot)Wang(at)emc(dot)com> |
---|---|
To: | "Nicolas Barbier" <nicolas(dot)barbier(at)gmail(dot)com> |
Cc: | <pgsql-cluster-hackers(at)postgresql(dot)org> |
Subject: | Re: How to copy Datum |
Date: | 2012-08-22 09:36:00 |
Message-ID: | 95FA8B25DB5E2D4E889EB9BEB6A6406F3CB0CB@CORPUSMX30B.corp.emc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | Postg토토 사이트 추천SQL : Postg토토 |
Sorry, it's my mistake, I was intended to send to -hackers, but I clicked the wrong email.
Anyway, I have solved the problem, thanks.
-----Original Message-----
From: Nicolas Barbier [mailto:nicolas(dot)barbier(at)gmail(dot)com]
Sent: 2012年8月22日 17:30
To: Wang, Chaoyong
Cc: pgsql-cluster-hackers(at)postgresql(dot)org
Subject: Re: [pgsql-cluster-hackers] How to copy Datum
2012/8/21 Wang, Chaoyong <Chaoyong(dot)Wang(at)emc(dot)com>:
[..]
> 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.
I suggest you ask this question on -hackers instead of here on
-cluster-hackers, as it doesn’t seem to have anything to do with
clustering.
Nicolas
--
A. Because it breaks the logical sequence of discussion.
Q. Why is top posting bad?