GiST: range of penalty method?

Поиск
Список
Период
Сортировка
От Neil Conway
Тема GiST: range of penalty method?
Дата
Msg-id 1100062155.14777.29.camel@localhost.localdomain
обсуждение исходный текст
Список pgsql-hackers
Does anyone know what the expected range of the "penalty" GiST method
is? (i.e. Is the legal range documented anywhere? Failing that, what
does existing GiST-based code expect?)

While rewriting gistchoose() in gist.c to be less obfuscated, it
occurred to me that (a) I don't think the existing code will work as
intended if a negative penalty is returned (b) it would be good to
define a "minimum legal penalty". Once the minimum penalty has been
returned for a particular location, GiST can know that all other
locations where it might insert the node will have a penalty greater
than or equal to that value, so gistchoose() can bail-out earlier.

Therefore, I'd like to make "0.0" is the minimum legal penalty, and
require all GiST "penalty" methods to return values >= 0. I think
requiring the penalty != NaN would also be a good idea. Comments?

Note that making this change to CVS tip results in a regression failure
in contrib/btree_gist. The regression.diffs are attached. The regression
tests for rtree_gist, tsearch, tsearch2 and pg_trgm succeed after making
the modification.

-Neil


Вложения

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

Предыдущее
От: John Hansen
Дата:
Сообщение: CREATE or REPLACE function pg_catalog.*
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: [Pgsphere-dev] GIST index concurrency concern