Re: [HACKERS] pow support for pgbench

rmrodriguez@carto.com

From: Raúl Marín Rodríguez <rmrodriguez@carto.com>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Robert Haas <robertmhaas@gmail.com>, Michael Paquier <michael.paquier@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2017-12-27T00:45:04Z
Lists: pgsql-hackers

Attachments

Hi,

I've implemented the overflow checks and made some benchmarks and the
ipow() version became slower except with some specific inputs (base 0 for
example). It's true that the new auxiliary functions could be optimized,
but I don't think it makes sense to keep working on them just to match
pow() speed.

I'm attaching both patches in case someone wants to have a look but I would
go with the simpler solution (pgbench_pow_v10.patch).

Regards,
-- 

*Raúl Marín Rodríguez *carto.com

Commits

  1. Add pow(), aka power(), function to pgbench.

  2. pgbench: Support double constants and functions.