• Tom Lane's avatar
    Avoid unnecessary precision loss for pgbench's --rate target. · 5b7e0367
    Tom Lane authored
    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.
    5b7e0367
pgbench.c 155 KB