Re: final patch - plpgsql: for-in-array - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: final patch - plpgsql: for-in-array
Date
Msg-id 4CE54DB7.9050800@dunslane.net
Whole thread Raw
In response to Re: final patch - plpgsql: for-in-array  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: final patch - plpgsql: for-in-array
List pgsql-hackers

On 11/18/2010 10:33 AM, Robert Haas wrote:
> On Thu, Nov 18, 2010 at 10:24 AM, Merlin Moncure<mmoncure@gmail.com>  wrote:
>>
>> Pavel's performance argument is imnsho valid. arrays at present are
>> the best way to pass data around functions and any optimizations here
>> are very welcome.  Given that, is there any way to mitigate your
>> concerns on the syntax side?
> Can we get the performance benefit any other way?  I hate to think
> that it will still be slow for people using the already-supported
> syntax.

It's not disastrously slower. AFAICT from a very quick glance over the 
patch, he's getting the speedup by bypassing the normal mechanism for 
evaluating "for x in select ...". So we'd have to special-case that to 
trap calls to unnest in the general form. That would be pretty ugly. Or 
else make unnest and SPI faster. But that's a much bigger project.

Syntactic sugar is not entirely to be despised, anyway.

cheers

andrew


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: final patch - plpgsql: for-in-array
Next
From: Cédric Villemain
Date:
Subject: Re: final patch - plpgsql: for-in-array