Re: Fix for seg picksplit function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fix for seg picksplit function
Date
Msg-id 3633.1289401632@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fix for seg picksplit function  (Alexander Korotkov <aekorotkov@gmail.com>)
List 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 by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: Fix for seg picksplit function
Next
From: Yeb Havinga
Date:
Subject: Re: Fix for seg picksplit function