pgbench calls random() later, so it should have called srandom().
On most platforms except Windows srandom() is actually identical
to srand(), so the bug only bites Windows users.
per bug report from Akio Ishida.
scenarios. With multiple clinets, only the first client got the right
scaling factor and this gave a illusion of better performance in case
of the scaling factor greater than 1.
max_stack_depth is not set to an unsafe value.
This commit also provides configure-time checking for <sys/resource.h>,
and cleans up some perhaps-unportable code associated with use of that
include file and getrlimit().
- predefined variable "tps"
The value of variable tps is taken from the scaling factor
specified by -s option.
- -D option
Variable values can be defined by -D option.
- \set command now allows arithmetic calculations.
comment line where output as too long, and update typedefs for /lib
directory. Also fix case where identifiers were used as variable names
in the backend, but as typedefs in ecpg (favor the backend for
indenting).
Backpatch to 8.1.X.
Remove unportable use of tfind/tsearch in favor of bsearch. Fix up
random number generator to use random() not rand() and to actually honor
its min/max arguments properly. That wasn't so important before, but
with exposure of capability to ask for general ranges, it will be.
warnings:
- remove pointless "extern" keyword from some function definitions in
contrib/tsearch2
- use "NULL" not "0" as NULL pointer in contrib/tsearch,
contrib/tsearch2, contrib/pgbench, and contrib/vacuumlo
only remnant of this failed experiment is that the server will take
SET AUTOCOMMIT TO ON. Still TODO: provide some client-side autocommit
logic in libpq.
Create objects in public schema.
Make spacing/capitalization consistent.
Remove transaction block use for object creation.
Remove unneeded function GRANTs.
false. per Tom Lane's suggestion. See:
Subject: Suggested change to pgbench
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tatsuo Ishii <t-ishii@sra.co.jp>
Cc: pgsql-patches@postgreSQL.org
Date: Sun, 06 Oct 2002 12:37:27 -0400
for more details.
snprintf() in contrib/. I didn't touch the places where pointer
arithmatic was being used, or other areas where the fix wasn't
trivial. I would think that few, if any, of the usages of sprintf()
were actually exploitable, but it's probably better to be paranoid...
Neil Conway
> Hi Tatsuo,
>
> I've attached a patch for the version of pgbench in CVS. It includes the
> following changes:
>
> - fix some spelling mistakes, indentation stuff, etc.
>
> - minor code cleanup -- (void) args instead of (), etc.
>
> - allocate the state array dynamically, so that it is only as
> large as needed. This reduces the memory consumption of pgbench
> slightly, and makes a larger MAXCLIENTS setting possible
>
> - (the only controversial change) add an option "-l" to log
> transaction latencies to a file. The "transaction latency"
> is the time between when the BEGIN is issued and the transaction
> commits. This is written to a file, along with the client #
> and the transaction #. The data in the file can then be used
> for things like:
>
> - consistency analysis: is the TPS the same through the
> entire run of pgbench, or does it change?
>
> - more detailed stats: what is the average latency, worse-case
> latency, best-case latency?
>
> - graphs: feed the data to gnuplot, graph latency versus. time
>
> - etc.
>
> I was going to store this data in memory and write it to disk
> at the end of the pgbench run, but that isn't feasible because
> the data can be very large: for example, ~70MB if benchmarking
> 128 clients doing 100,000 transactions each.
>
> Cheers,
>
> Neil