Andrew Borodin <borodin(at)octonica(dot)com> writes:
> Currently GiST treats NaN penalty as zero penalty, in terms of
> generalized tree this means "perfect fit". I think that this situation
> should be considered "worst fit" instead.
On what basis? It seems hard to me to make any principled argument here.
Certainly, "NaN means infinity", as your patch proposes, has no more basis
to it than "NaN means zero". If the penalty function doesn't like that
interpretation, it shouldn't return NaN.
regards, tom lane