Re: About aggregates...

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Michael Giannakopoulos *EXTERN*" <miccagiann(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: About aggregates...
Date: 2012-11-30 09:08:26
Message-ID: D960CB61B694CF459DCFB4B0128514C208C0C9B3@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Giannakopoulos wrote:
> I would like to ask if there is any way to make an aggregate function
to take a set of tuples as an
> input variable. I know that an actual aggregate function receives each
tuple one at a time and process
> it on the fly. However I want to store tuples in an incremental
fashion so as to process them in a
> batch approach in the finalaggr function. Think for example
implementing logistic regression (which is
> an OLAP query by its nature). I want to support it with the current
features that PostgreSQL provides
> from which the closest feature is an aggregate. However an aggregate
function feeds me one a tuple for
> each call, but I would like to have access to a batch of tuples per
function call. Is there any
> possible way to perform something like this?

If you write in C, there is nothing that keeps you from
storing all the rows that come in in memory allocated in
a suitable MemoryContext and process them all at the end.

You might run out of memory though.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message maxxedev maxxedev 2012-11-30 09:29:38 postgres timestamp data errors
Previous Message Albe Laurenz 2012-11-30 09:04:55 Re: libpq - PQsendQuery wait for complete result