Re: final patch - plpgsql: for-in-array

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: final patch - plpgsql: for-in-array
Дата
Msg-id AANLkTikF6Os3_VrkhDnbYAmEZ2vJDH-fsP=koCdYHM+j@mail.gmail.com
обсуждение исходный текст
Ответ на Re: final patch - plpgsql: for-in-array  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: final patch - plpgsql: for-in-array  (Cédric Villemain <cedric.villemain.debian@gmail.com>)
Re: final patch - plpgsql: for-in-array  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: final patch - plpgsql: for-in-array  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On Thu, Nov 18, 2010 at 10:24 AM, Merlin Moncure <mmoncure@gmail.com> wrote:
> On Thu, Nov 18, 2010 at 12:47 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Merlin Moncure <mmoncure@gmail.com> writes:
>>> On Wed, Nov 17, 2010 at 7:08 PM, Jaime Casanova <jaime@2ndquadrant.com> wrote:
>>>> i will start the review of this one... but before that sorry for
>>>> suggesting this a bit later but about using UNNEST as part of the
>>>> sintax?
>>
>>> Does for-in-array do what unnset does?
>>
>> Yes, which begs the question of why bother at all.  AFAICS this patch
>> simply allows you to replace
>>
>>        for x in select unnest(array_value) loop
>>
>> with
>>
>>        for x in unnest array_value loop
>>
>> (plus or minus a parenthesis or so).  I do not think we need to add a
>> bunch of code and create even more syntactic ambiguity (FOR loops are
>> already on the hairy edge of unparsability) to save people from writing
>> "select".
>
> 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.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Cédric Villemain
Дата:
Сообщение: Re: final patch - plpgsql: for-in-array
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: EXPLAIN and nfiltered