Re: [HACKERS] pow support for pgbench - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: [HACKERS] pow support for pgbench
Date
Msg-id alpine.DEB.2.20.1712060647280.19178@lancre
Whole thread Raw
In response to Re: [HACKERS] pow support for pgbench  (Robert Haas <robertmhaas@gmail.com>)
List 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.


pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table
Next
From: Amit Kapila
Date:
Subject: Re: explain analyze output with parallel workers - question aboutmeaning of information for explain.depesz.com