Re: Fix for seg picksplit function

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: Fix for seg picksplit function
Дата
Msg-id AANLkTimL7-iLSfv23osE6WO-s9FQQNBq3vBnCbZ7DYVS@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fix for seg picksplit function  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Fix for seg picksplit function  (Yeb Havinga <yebhavinga@gmail.com>)
Список pgsql-hackers
On Tue, Nov 16, 2010 at 3:07 AM, Robert Haas <robertmhaas@gmail.com> wrote:
The loop that begins here:

   for (i = 0; i < maxoff; i++)
   {
       /* First half of segs goes to the left datum. */
       if (i < seed_2)

...looks like it should perhaps be broken into two separate loops.
That might also help tweak the logic in a way that eliminates this:

seg.c: In function ‘gseg_picksplit’:
seg.c:327: warning: ‘datum_r’ may be used uninitialized in this function
seg.c:326: warning: ‘datum_l’ may be used uninitialized in this function
I restored original version of that loop.
 
But on a broader note, I'm not very certain the sorting algorithm is
sensible.  For example, suppose you have 10 segments that are exactly
'0' and 20 segments that are exactly '1'.  Maybe I'm misunderstanding,
but it seems like this will result in a 15/15 split when we almost
certainly want a 10/20 split.  I think there will be problems in more
complex cases as well.  The documentation says about the less-than and
greater-than operators that "These operators do not make a lot of
sense for any practical purpose but sorting."
I think almost any split algorithm has corner cases when it's results don't look very good. I think the way to understand significance of these corner cases for real life is to perform sufficient testing on datasets which is close to real life. I'm not feeling power to propose enough of test datasets and estimate their significance for real life cases, and I need help in this field.

----
With best regards,
Alexander Korotkov. 
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Improved parallel make support
Следующее
От: Shigeru HANADA
Дата:
Сообщение: Re: SQL/MED estimated time of arrival?