pgsql: Avoid unnecessary precision loss for pgbench's --rate target.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid unnecessary precision loss for pgbench's --rate target.
Date: 2018-09-25 15:09:26
Message-ID: E1g4oxq-00087H-H1@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid unnecessary precision loss for pgbench's --rate target.

It's fairly silly to truncate the throttle_delay to integer when the only
math we ever do with it requires converting back to double. Furthermore,
given that people are starting to complain about restrictions like only
supporting 1K client connections, I don't think we're very far away from
situations where the precision loss matters. As the code stood, for
example, there's no difference between --rate 100001 and --rate 111111;
both get converted to throttle_delay = 9. Somebody trying to run 100
threads and have each one dispatch around 1K TPS would find this lack of
precision rather surprising, especially since the required per-thread
delays are around 1ms, well within the timing precision of modern systems.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5b7e036707ccd93506731da82a56b07023d13e30

Modified Files
--------------
src/bin/pgbench/pgbench.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-09-25 17:24:06 pgsql: Make some fixes to allow building Postgres on macOS 10.14 ("Moja
Previous Message Thomas Munro 2018-09-25 02:59:50 pgsql: Constify dsa_size_class_map and use a better type.