Re: Fix for GiST penalty

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Fix for GiST penalty
Дата
Msg-id 4DE4A1A1.7070302@enterprisedb.com
обсуждение исходный текст
Ответ на Fix for GiST penalty  (Alexander Korotkov <aekorotkov@gmail.com>)
Ответы Re: Fix for GiST penalty
Список pgsql-hackers
On 31.05.2011 01:07, Alexander Korotkov wrote:
> In gist_box_penalty function floating point error in line
>    *result = (float) (size_box(ud) - size_box(origentry->key));
> sometimes makes *result a very small negative number.
> I beleive that best place to fix it is gistpenalty function. The attached
> patch makes this function treating negative number from user's penalty as
> zero. I didn't find mention of negative penalty value in documentation. So,
> AFAICS such behaviour shouldn't break anything.
> After the patch index performance is ok.

Yeah, there seems to be a hidden assumption that the return value of the 
penalty function is always >= 0. The logic in gistchoose() in particular 
seems to assume that, by using < 0 to mean uninitialized slots in the 
which_grow array.

The documentation should be fixed too.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Getting a bug tracker for the Postgres project
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Getting a bug tracker for the Postgres project