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

From: Emre Hasegeli <emre(at)hasegeli(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, nospam-pg-abuse(at)bloodgate(dot)com, Amit Langote <amitlangote09(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, keisuke kuroda <keisuke(dot)kuroda(dot)3862(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: In PG12, query with float calculations is slower than PG11
Date: 2020-02-13 16:25:25
Message-ID: CAE2gYzxnga06ktaqXw4E0K--qAU2pkyvyxPv0CG_3VLR5f7cKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > > > 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
> >
> > Cool. Emre, any chance you could write a patch along those lines?
>
> Yes, I am happy to do. It makes more sense to me too.

How about the one attached?

Attachment Content-Type Size
0001-Optimize-float-overflow-underflow-checks-v3.patch text/x-patch 29.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-02-13 16:26:45 Re: Small docs bugfix: make it clear what can be used in UPDATE FROM and DELETE USING
Previous Message Tom Lane 2020-02-13 16:04:03 Re: assert pg_class.relnatts is consistent