Re: On disable_cost

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: On disable_cost
Дата
Msg-id 6da76620383a421c2f4164bd314bab9499d2ec5c.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: On disable_cost  (Jim Finnerty <jfinnert@amazon.com>)
Ответы Re: On disable_cost  (Greg Stark <stark@mit.edu>)
Re: On disable_cost  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
On Tue, 2019-12-10 at 15:50 -0700, Jim Finnerty wrote:
> As a proof of concept, I hacked around a bit today to re-purpose one of the
> bits of the Cost structure to mean "is_disabled" so that we can distinguish
> 'disabled' from 'non-disabled' paths without making the Cost structure any
> bigger.  In fact, it's still a valid double.  The obvious choice would have
> been to re-purpose the sign bit, but I've had occasion to exploit negative
> costs before so for this POC I used the high-order bit of the fractional
> bits of the double.  (see Wikipedia for double precision floating point for
> the layout).
> 
> The idea is to set a special bit when disable_cost is added to a cost. 
> Dedicating multiple bits instead of just 1 would be easily done, but as it
> is we can accumulate many disable_costs without overflowing, so just
> comparing the cost suffices.

Doesn't that rely on a specific implementation of double precision (IEEE)?
I thought that we don't want to limit ourselves to platforms with IEEE floats.

Yours,
Laurenz Albe




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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Windows buildfarm members vs. new async-notify isolation test
Следующее
От: Koichi Suzuki
Дата:
Сообщение: get_database_name() from background worker