pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid unnecessary precision loss for pgbench's --rate target.
Date: Tue, 25 Sep 2018 15:09:26 +0000
Message-ID: <E1g4oxq-00087H-H1@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1g4oxq-00087H-H1@gemulon.postgresql.org>
Permalink:  ../E1g4oxq-00087H-H1@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1g4oxq-00087H-H1@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Avoid unnecessary precision loss for pgbench's --rate target.
  In-Reply-To: <E1g4oxq-00087H-H1@gemulon.postgresql.org>
  References: <E1g4oxq-00087H-H1@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox