Re: arrays as pl/perl input arguments [PATCH]

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: arrays as pl/perl input arguments [PATCH]
Дата
Msg-id 4D5155E6.6040408@dunslane.net
обсуждение исходный текст
Ответ на Re: arrays as pl/perl input arguments [PATCH]  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: arrays as pl/perl input arguments [PATCH]  (Tim Bunce <Tim.Bunce@pobox.com>)
Список pgsql-hackers

On 02/03/2011 01:20 PM, Andrew Dunstan wrote:
>>>> - Every existing plperl function that takes arrays is going to get
>>>>   slower due to the overhead of parsing the string and allocating the
>>>>   array and all its elements.
>>> Well, per my understanding of Alex changes, the string parsing is 
>>> not invoked
>>> unless requested by referencing the array in a string context. 
>>> Normally, onle
>>> plperl_ref_from_pg_array will be invoked every time the function is 
>>> called
>>> with an array argument, which would take little time to convert the 
>>> PostgreSQL
>>> internal array representation (not a string) to the perl references, 
>>> but that's
>>> no different from what is already done with composite type 
>>> arguments, which
>>> are converted to perl hash references on every corresponding 
>>> function call.
>> I'd missed that it was using the internal array representation (obvious
>> in hindsight) but there's still a significant cost in allocating the SVs
>> that won't be used by existing code.  Though I agree it's of the same
>> order as for composite types.
>>
>
> Well, the question seems to be whether or not it's a reasonable price 
> to pay. On the whole I'm inclined to think it is, especially when it 
> can be avoided by updating your code, which will be a saving in 
> fragility and complexity as well.
>


Tim,

do you till have concerns about this, or are you happy for us to move 
ahead on it?

cheers

andrew


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Named restore points
Следующее
От: Hitoshi Harada
Дата:
Сообщение: Re: postponing some large patches to 9.2