Re: plperl (7.5) - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: plperl (7.5)
Date
Msg-id 20040711050547.GB14600@dcc.uchile.cl
Whole thread Raw
In response to plperl (7.5)  (elein <elein@varlena.com>)
Responses Re: plperl (7.5)
List pgsql-hackers
On Sat, Jul 10, 2004 at 09:18:28PM -0700, elein wrote:
> The new plperl returns sets by having 
> the function return an array.
> 
> This requires that the entire array be
> built before anything is returned.
> 
> It seems to me that that does not scale
> very well.  The technique of RETURN NEXT;
> scales much better.

I think RETURN NEXT does the same thing anyway ... they just store
tuples in a Tuplestore and then the whole thing is returned.  So the
function actually doesn't return until the whole function is done.

The set-returning-function infraestructure actually has a mode on which
you can return one tuple per call, but PL/pgSQL uses only the other
mode, materializing the whole set before return.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"El conflicto es el camino real hacia la unión"



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Nested Transactions, Abort All
Next
From: Dennis Bjorklund
Date:
Subject: Re: Nested Transactions, Abort All