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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Florian Pflug <fgp(at)phlo(dot)org>, David Rowley <dgrowleyml(at)gmail(dot)com>, Kevin Grittner <kgrittn(at)ymail(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-04-11 17:25:43
Message-ID: 31823.1397237143@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
> On 10 April 2014 19:54, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> So if we go with that terminology, perhaps these names for the
>> new CREATE AGGREGATE parameters:
>>
>> initfunc applies to plain aggregation, mutually exclusive with initcond
>> msfunc (or just mfunc?) forward transition for moving-agg mode
>> mifunc inverse transition for moving-agg mode
>> mstype state datatype for moving-agg mode
>> msspace space estimate for mstype
>> mfinalfunc final function for moving-agg mode
>> minitfunc "firsttrans" for moving-agg mode
>> minitcond mutually exclusive with minitfunc

> Yeah, those work for me.

> I think I prefer "mfunc" to "msfunc", but perhaps that's just my
> natural aversion to the "ms" prefix :-)

Meh. We've got mstype, and I don't think leaving out the "s" there
feels right.

> Also, perhaps "minvfunc" rather than "mifunc" because "i" by itself
> could mean "initial".

Good point. So with initfuncs out of the picture, we have
new CREATE AGGREGATE parameter names

msfunc forward transition for moving-agg mode
minvfunc inverse transition for moving-agg mode
mfinalfunc final function for moving-agg mode
mstype state datatype for moving-agg mode
msspace space estimate for mstype
minitcond initial state value for moving-agg mode

and new pg_aggregate columns

aggmtransfn | regproc | not null
aggminvtransfn | regproc | not null
aggmfinalfn | regproc | not null
aggmtranstype | oid | not null
aggmtransspace | integer | not null
aggminitval | text |

It's a bit unfortunate that the catalog column names aren't quite on
the same page as CREATE AGGREGATE, but it doesn't seem like a good
idea to try to fix that now.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-04-11 17:42:26 Re: [PATCH] Negative Transition Aggregate Functions (WIP)
Previous Message Florian Pflug 2014-04-11 17:25:02 Re: [PATCH] Negative Transition Aggregate Functions (WIP)