Re: [HACKERS] Non-deterministic behavior with floating point in parallel mode

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Non-deterministic behavior with floating point in parallel mode
Дата
Msg-id 3455.1486046960@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [HACKERS] Non-deterministic behavior with floating point in parallel mode  (Ruben Buchatskiy <ruben@ispras.ru>)
Ответы Re: [HACKERS] Non-deterministic behavior with floating point inparallel mode  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-hackers
Ruben Buchatskiy <ruben@ispras.ru> writes:
> We have found that in parallel mode result of queries is non-deterministic
> when the types of the attributes in table are double precision
> (floating-point).

Yeah ...

> That is because floating-point addition is not necessarily associative.

Right, exactly.

> Is this desirable behavior?

It's not especially the fault of parallelism.  Any change in the order in
which the SUM visits the rows could cause a similar change in the results.
IOW, you are being overoptimistic about how deterministic this result
is any of the time.

Use numeric, not float, if you can't tolerate this sort of behavior.
        regards, tom lane



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

Предыдущее
От: Petr Jelinek
Дата:
Сообщение: Re: [HACKERS] Enabling replication connections by default inpg_hba.conf
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] PoC: Make it possible to disallow WHERE-less UPDATE and DELETE