>>>>> "Martijn" == Martijn van Oosterhout <klep...@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 tries to split >> the data again based on the positions of the box centers. But >> there's a problem here with floating-point rounding; it's possible >> for the average of N floating-point values to be strictly greater >> (or less) than all 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 predictable results. Martijn> ISTM the simplest solution here is detect that everything Martijn> has been put in one node (left or right) and in that case Martijn> just split the list straight down the middle (since clearly Martijn> it doesn't matter on which side they appear.). 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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers