Re: Fix for seg picksplit function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Yeb Havinga <yebhavinga(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix for seg picksplit function
Date: 2010-11-10 15:07:12
Message-ID: 3633.1289401632@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alexander Korotkov <aekorotkov(at)gmail(dot)com> writes:
> On Wed, Nov 10, 2010 at 4:53 PM, Alexander Korotkov <aekorotkov(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yeb Havinga 2010-11-10 15:13:32 Re: Fix for seg picksplit function
Previous Message Alexander Korotkov 2010-11-10 15:06:22 Re: Fix for seg picksplit function