Re: [HACKERS] Non-deterministic behavior with floating point in parallel mode
В списке pgsql-hackers по дате отправления:
| От | 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
|
| Список | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера