Hello,
Finally I used a function below which works well. Only one problem is
left: It polutes the buffer cache because of the cursor. Any idea to get
rid of this behavior?
BTW: WINDOWING FUNCTION of 8.4 should help but noone could provide an
examples how this could work. Any further comments
nterdite. Ce message sert à l'information seulement et n'aura pas n'importe
quel effet légalement obligatoire. Étant donné que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> Subject: Re: [GE
Hello,
I've found a dirty hack with custom GUC variables here:
http://archives.postgresql.org/pgsql-hackers/2008-11/msg00643.php
Although dirty, it seems that it beats the windowing performances of
8.4.
So I wonder if there are any concern about this...
Cheers,
Marc Mamin
--
Sent via pg
Gerhard Wiesinger wrote:
I've the following data:
datetime | val1 | val2
time1| 4 | 40%
time2| 7 | 30%
time3| 12 | 20%
...
I'd like to sum up the following:
(7-4)*30% + (12-7)*20% + ...
datetime is ordered (and unique and has also an id).
1.) Self join with
On 8 Jun 2009, at 19:01, David Fetter wrote:
Hello!
I've the following data:
datetime | val1 | val2
time1|4 | 40%
time2|7 | 30%
time3| 12 | 20%
...
I'd like to sum up the following:
(7-4)*30% + (12-7)*20% + ...
This is best done in 8.4 using Windowing. Sadly, it's an
Gerhard Wiesinger writes:
> Any hints for an 8.3 environment (currently)?
Use a FOR loop in plpgsql and remember the previous row's value in a
variable.
regards, tom lane
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subsc
Any hints for an 8.3 environment (currently)?
Thnx.
Ciao,
Gerhard
--
http://www.wiesinger.com/
On Mon, 8 Jun 2009, David Fetter wrote:
On Mon, Jun 08, 2009 at 08:35:20AM +0200, Gerhard Wiesinger wrote:
Hello!
I've the following data:
datetime | val1 | val2
time1|4 | 40%
time2
On Mon, Jun 08, 2009 at 08:35:20AM +0200, Gerhard Wiesinger wrote:
> Hello!
>
> I've the following data:
> datetime | val1 | val2
> time1|4 | 40%
> time2|7 | 30%
> time3| 12 | 20%
> ...
>
> I'd like to sum up the following:
>
> (7-4)*30% + (12-7)*20% + ...
This is best done i
Hello!
I've the following data:
datetime | val1 | val2
time1|4 | 40%
time2|7 | 30%
time3| 12 | 20%
...
I'd like to sum up the following:
(7-4)*30% + (12-7)*20% + ...
datetime is ordered (and unique and has also an id).
Rows are in the area of millions.
How is it done be