Re: Crash in gist insertion on pathological box data

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: Crash in gist insertion on pathological box data
Дата
Msg-id 877i29en7b.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на Re: Crash in gist insertion on pathological box data  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
>>>>> "Martijn" == Martijn van Oosterhout <kleptog@svana.org> writes:
>> The nature of the problem is this: if gist_box_picksplit doesn't>> find a good disposition on the first try, then it
triesto split>> the data again based on the positions of the box centers. But>> there's a problem here with
floating-pointrounding; it's possible>> for the average of N floating-point values to be strictly greater>> (or less)
thanall of the values individually, and the function>> then returns with, for example, all the entries assigned to
the>>left node, and nothing in the right node. This causes gistSplit to>> try and split the left node again, with
predictableresults.
 
Martijn> ISTM the simplest solution here is detect that everythingMartijn> has been put in one node (left or right) and
inthat caseMartijn> just split the list straight down the middle (since clearlyMartijn> it doesn't matter on which side
theyappear.).
 

It's not quite so simple; we know that not all the values are equal,
since that's checked for earlier in the code (if they're all actually
equal they just get split down the middle). In this specific case the
values could actually be quite different, since we're only looking
at the centers; and with, say, a large number of very different size
boxes all centered on the same point, it would be preferable to split
them so that at least one node has a smaller union.

I'm interested to see what Oleg's solution (see other thread) is.

-- 
Andrew.


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: 8.4 release notes proof reading 1/2
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: TODO item