Re: [HACKERS] pow support for pgbench

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Raúl Marín Rodríguez <rmrodriguez(at)carto(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] pow support for pgbench
Date: 2017-12-06 05:58:00
Message-ID: alpine.DEB.2.20.1712060647280.19178@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>> In both cases we'd return a double but we use the fast ipow if it's
>> possible (which can be 20x faster), so at the cost of an extra cast if
>> you need an int, we'd have a consistent API. Would this be acceptable?
>
> It seems OK to me.

Computing as an int, casting to double and back to int8 can generate a
loss of precision. However for powers of 2 it works exactly, so eg
computing a mask it would be ok.

This proposal does not exactly match SQL behavior, but I do not see this
as a problem, which is why I was happy with the previous proposal.

--
Fabien.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-12-06 06:05:09 Re: explain analyze output with parallel workers - question about meaning of information for explain.depesz.com
Previous Message Andres Freund 2017-12-06 04:17:15 Re: pgsql: Support Parallel Append plan nodes.