Re: GiST penalty functions [PoC]

Поиск
Список
Период
Сортировка
От Andrew Borodin
Тема Re: GiST penalty functions [PoC]
Дата
Msg-id CAJEAwVHP_oQg39cZYbix7F5-Ubx4WS+eoFY-2UhKu3_7=gTPhA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: GiST penalty functions [PoC]  (Andrew Borodin <borodin@octonica.com>)
Ответы Re: GiST penalty functions [PoC]  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-hackers
Well, arithmetics is too fragile.

This version of float packing with arithmetical packaging
static float
pack_float(float actualValue, int realm)
{
double max,min;
max = FLT_MAX / ( 8 >> realm );
min = FLT_MAX / ( 16 >> realm );
if( realm == 0 )
min = 0;
/* squeeze the actual value between min and max */
return ( min + (actualValue * ( max - min ) / FLT_MAX));
}

Inserts are the same as of bithacked pack_float, but selects are 5 times slower.
When we are trying to pack value linearly into range we loose too much bits.
Here is how it happens: in floats addition of small values to big
values causes loss of small values.
Applied to Heikki's algorithm this means that nV, nE and dV can all be
in different mantissa ranges. (Please note that dV ca be many times
more than nV and many times smaller that nV)

Integer bitshift of a float have no arithmetical meaning. It would be
hard to describe in formulas what carring of mantissa bit to
significant field mean. But this bitshift preserves an order among
almost all float values (except 2 controllably lost bits and some
values become sNaN ). Entire idea of the advanced GiST penalty stands
on this.

The other way is to add to API optional handler which executes all of
choose subtree algorithm inside cube (or other extension).

Best regards, Andrey Borodin, Octonica & Ural Federal University.



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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Hash Indexes
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: amcheck (B-Tree integrity checking tool)