Re: In PG12, query with float calculations is slower than PG11

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: In PG12, query with float calculations is slower than PG11
Дата
Msg-id 9564.1581535110@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: In PG12, query with float calculations is slower than PG11  (Andres Freund <andres@anarazel.de>)
Ответы Re: In PG12, query with float calculations is slower than PG11  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> I do wonder if we're just punching ourselves in the face with the
> signature of these checks. Part of the problem here really comes from
> using the same function to handle a number of different checks.

Yeah, I've thought that too.  It's *far* from clear that this thing
is a win at all, other than your point about the number of copies of
the ereport call.  It's bulky, it's hard to optimize, and I have
never thought it was more readable than the direct tests it replaced.

> For most places it'd probably end up being easier to read and to
> optimize if we just wrote them as
> if (unlikely(isinf(result)) && !isinf(arg))
>     float_overflow_error();
> and when needed added a
> else if (unlikely(result == 0) && arg1 != 0.0)
>     float_underflow_error();

+1

            regards, tom lane



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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: Collation versioning
Следующее
От: Andres Freund
Дата:
Сообщение: Re: In PG12, query with float calculations is slower than PG11