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

From Pavel Stehule
Subject Re: final patch - plpgsql: for-in-array
Date
Msg-id AANLkTi=cwb-z_YbP61a-cAeGzY3aqqkKbbgPK4XLsiba@mail.gmail.com
Whole thread Raw
In response to Re: final patch - plpgsql: for-in-array  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
2010/11/18 Tom Lane <tgl@sss.pgh.pa.us>:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> this note was a different -only  a few people use FOR IN SELECT UNNEST
>> for iteration over array. So from Robert's question (what is important
>> for current code?) perspective the more significant is access to
>> individual fields via subscripts. For example:
>
>> for i in 1..10000 loop
>>   s := s + A[i];
>> end loop
>
>> is slow, when high limit of array is some bigger number > 1000.
>
> True, but inventing new FOR syntax isn't going to help people who are
> used to doing that.

sure - I don't try it. Any change of this mean significant plpgsql's
refactoring and significant increasing the size and complexity of
code. More there can be still some overhead, because subscript can be
expression. And in almost all cases people dislike to write
subscripts.

>
>                        regards, tom lane
>


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: final patch - plpgsql: for-in-array
Next
From: Heikki Linnakangas
Date:
Subject: Re: Per-column collation