Re: [PATCH] Negative Transition Aggregate Functions (WIP)

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Grittner <kgrittn(at)ymail(dot)com>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Greg Stark <stark(at)mit(dot)edu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Negative Transition Aggregate Functions (WIP)
Date: 2014-01-18 05:44:24
Message-ID: CAApHDvpjmn1YoL-ssxVcSpe=Ahw-ezWJHuByNSqbEtiekS+wXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 18, 2014 at 6:15 PM, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:

> On Sat, Jan 18, 2014 at 2:20 PM, Florian Pflug <fgp(at)phlo(dot)org> wrote:
>
>> * Don't we need to check for volatile function in the filter expression
>> too?
>>
>
>>
> I did manual testing on this before and the volatility test for the
> aggregate arguments seems to cover this. I didn't look into why but it just
> did. I've not test this again since your refactoring. I could test this
> easily before when my numeric case was changing the results because of the
> dscale problem, I noticed that if I did FILTER(WHERE random() > 0) that the
> extra trailing zeros would disappear.
> The problem now is that it's pretty hard to determine if an inverse
> transition took place, the only way we can really tell is performance. I'll
> see if I can invent a new test case for this by creating a user defined
> aggregate as you described. I'm thinking just append '+' to a string for
> transitions and '-' to a string for inverse transitions, then just make
> sure we only have a string of '+'s when doing something like filter(where
> random() >= 0).
>
>
>
I've added a test case for this and it seem work as expected:
https://github.com/david-rowley/postgres/commit/43a5021e8f8ae1af272e7e21a842d1b0d5cbe577

Regards

David Rowley

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2014-01-18 07:42:45 Re: currawong is not a happy animal
Previous Message Tom Lane 2014-01-18 05:43:15 Re: [PATCH] Make various variables read-only (const)