Re: GiST for range types (was Re: Range Types - typo + NULL string constructor)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: GiST for range types (was Re: Range Types - typo + NULL string constructor)
Дата
Msg-id 21060.1322438402@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: GiST for range types (was Re: Range Types - typo + NULL string constructor)  (Alexander Korotkov <aekorotkov@gmail.com>)
Ответы Re: GiST for range types (was Re: Range Types - typo + NULL string constructor)  (Alexander Korotkov <aekorotkov@gmail.com>)
Список pgsql-hackers
Alexander Korotkov <aekorotkov@gmail.com> writes:
> On Sun, Nov 27, 2011 at 10:43 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 1. penalty is using both hard-wired penalty values (1.0, 2.0, etc) and
>> values obtained from subtype_diff.  This is not good, because you have
>> no idea what scale the subtype differences will be expressed on.  The
>> hard-wired values could be greatly larger than range widths, or greatly
>> smaller, resulting in randomly different index behavior.

> Current GiST code only compare penalty values of inserting same tuple. And
> don't see why it may alters. So, values obtained from subtype_diff
> and hard-wired values would be never compared each other.

I see your point that we only need the penalty values to be comparable
for the same "new" value, but I don't think that really answers my
objection, because you've had to lobotomize the logic.  As an example,
if we have a new empty range to insert, and all the existing root-page
entries are ordinary finite ranges, this code will throw up its hands
and give them all the same 4.0 penalty value.  Surely it would be better
to attempt to pick the smallest (narrowest) existing range.  But to do
that, you have to pay attention to the subdiff value.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: hiding variable-length fields from Form_pg_* structs
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: pg_upgrade automatic testing