Re: [HACKERS] pow support for pgbench
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Raúl Marín Rodríguez <rmrodriguez@carto.com>, Michael Paquier <michael.paquier@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2017-12-04T20:38:44Z
Lists: pgsql-hackers
On Mon, Dec 4, 2017 at 10:47 AM, Fabien COELHO <coelho@cri.ensmp.fr> wrote: >> What's the name of the backend function whose behavior this matches? >> >> As Fabien has mentioned, it tries to behave as "numeric_power". Maybe we >> it'd better if we switch to "dpow" (which is pow with some error handling) >> and always return a double. What do you think? > > My 0.02€: I think that having a integer pow implementation when possible is > a good think for pgbench, because the main use case is to deal with table > keys in a benchmarking scripts, which are expected to be integers. I'm willing to commit any of the following things: 1. A patch that adds an integer version of pow() but not a double version 2. A patch that adds a double version of pow() but not an integer version 3. A patch that adds both an integer version of pow() and a double version of pow(), with the two versions having different names If Raúl is happy with only having an integer version, then I suggest that he adopt #1 and call it good. Otherwise, given that Fabien wants the double version, I suggest we call the integer version pow() and the double version dpow() and go with #3. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Add pow(), aka power(), function to pgbench.
- 7a727c180aa3 11.0 landed
-
pgbench: Support double constants and functions.
- 86c43f4e22c0 9.6.0 cited