Re: plperl (7.5)

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: elein <elein(at)varlena(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: plperl (7.5)
Date: 2004-07-17 23:52:39
Message-ID: 40F9BBC7.3000209@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.
>
>

Indeed.

>For example, you maybe selecting rows,
>doing a little formating and adding some
>information and returning the rows as you
>process them. It the table you are selecting
>is very large, you still have to hold the
>results in memory to return them all at
>once.
>
>Am I misunderstanding something or can
>someone explain the reasoning?
>
>

The reasoning behind the current set of new features is simple - what
has been provided is what we were able to get done before feature
freeze. It is not by any means all that is intended by the plperlng
project. The rest will have to wait for another release.

>In an ideal implementation both techniques
>would be possible since returning the array
>is kind of cool ;-)
>
>
>
>

Quite so. I think we would have to provide a callback procedure to add a
resultset member, and we could easily have it set a flag so that if it
had been used in the function call we would use that method of
accumulating resultset members, otherwise we would use the current
all-at-once method.

But before we embark on any such exercise, we need to have a good
discussion of future features and APIs. My intention was to start that
discussion after we put the 7.5 stuff to bed. Please feel free to join
the plperlng-devel mailing list.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthew T. O'Connor 2004-07-18 00:06:53 Vacuum Cost Documentation?
Previous Message Gaetano Mendola 2004-07-17 23:07:32 NT and aborted transaction