Re: Fix for seg picksplit function

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Alvaro Herrera <alvherre@commandprompt.com>, Yeb Havinga <yebhavinga@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2010-11-10T15:07:12Z
Lists: 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