Re: Fix for seg picksplit function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fix for seg picksplit function
Дата
Msg-id 3633.1289401632@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Fix for seg picksplit function  (Alexander Korotkov <aekorotkov@gmail.com>)
Список pgsql-hackers
Alexander Korotkov <aekorotkov@gmail.com> writes:
> On Wed, Nov 10, 2010 at 4:53 PM, Alexander Korotkov <aekorotkov@gmail.com>wrote:
>> Actually I can't understand the purpose of FirstOffsetNumber
>> and OffsetNumberNext macros.

> For example, if we assume, that OffsetNumberNext can do something other that
> just increment, that we shouldn't use it in loop on sortItems,

Right.  Good style is to use FirstOffsetNumber/OffsetNumberNext if you
are walking through the items on a page.  They should *not* be used when
you are just iterating over a local array.  I'd go with "for (i = 0;
i < nitems; i++)" for the latter.
        regards, tom lane


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

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: Fix for seg picksplit function
Следующее
От: Yeb Havinga
Дата:
Сообщение: Re: Fix for seg picksplit function