Re: Fix for seg picksplit function
Alvaro Herrera <alvherre@commandprompt.com>
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Yeb Havinga <yebhavinga@gmail.com>
Cc: Alexander Korotkov <aekorotkov@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2010-11-10T13:27:54Z
Lists: pgsql-hackers
Hmm, the second for loop in gseg_picksplit uses "i < maxoff" whereas the other one uses <=. The first is probably correct; if the second is also correct it merits a comment on the discrepancy (To be honest, I'd get rid of the "-1" in computing maxoff and use < in both places, given that offsets are 1-indexed). Also, the second one is using i++ to increment; probably should be OffsetNumberNext just to stay consistent with the rest of the code. The assignment to *left and *right at the end of the routine seem pretty useless (not to mention the comment talking about a routine that doesn't exist anywhere). -- Álvaro Herrera <alvherre@commandprompt.com> The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support