Re: Fix for seg picksplit function

From: Yeb Havinga <yebhavinga(at)gmail(dot)com>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix for seg picksplit function
Date: 2010-11-10 15:05:13
Message-ID: 4CDAB4A9.6080801@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2010-11-10 15:46, Alexander Korotkov wrote:
> On Wed, Nov 10, 2010 at 5:37 PM, Yeb Havinga <yebhavinga(at)gmail(dot)com
> <mailto:yebhavinga(at)gmail(dot)com>> wrote:
>
> They are necessary and it is code untouched by this patch, and the
> same line occurs in other picksplit functions as well. The
> gbt_num_picksplit function shows that it can be avoided, by
> rewriting in the second loop
>
> *left++ = sortItems[i].index;
> into
> v->spl_left[v->spl_nleft] = sortItems[i].index
>
> Even though this is longer code, I prefer this variant over the
> shorter one.
>
> I can't understand this point. How the way of spl_left
> and spl_right arrays filling is related with
> additional FirstOffsetNumber value at the end of array, which is
> added by "*left = *right = FirstOffsetNumber;" line?
You're right, they are not related. I'm no longer sure it is necessary,
looking at gistUserPicksplit.

regards,
Yeb Havinga

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2010-11-10 15:06:22 Re: Fix for seg picksplit function
Previous Message Alexander Korotkov 2010-11-10 14:46:25 Re: Fix for seg picksplit function