pgsql: Arrange to generate different random sequences in the different - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Arrange to generate different random sequences in the different
Date
Msg-id 20091211215006.8577B753FB7@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Arrange to generate different random sequences in the different child
processes of a pgbench run, when we are using -j > 1 and are emulating
threads via fork().  Otherwise the children all inherit the same random
sequence state and produce the same random-number sequence.

In the threaded case the different threads will share one RNG state, so
they will produce different subsets of one sequence, which is maybe more
correlated than a purist would like but will not be "the same".  So we
leave that case alone.

First noticed by Takahiro Itagaki, and is also part of the explanation
for the pgbench misbehavior recently reported by Jaime Casanova.

Modified Files:
--------------
    pgsql/contrib/pgbench:
        pgbench.c (r1.91 -> r1.92)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/pgbench/pgbench.c?r1=1.91&r2=1.92)

pgsql-committers by date:

Previous
From: fxjr@pgfoundry.org (User Fxjr)
Date:
Subject: npgsql - Npgsql2: Bug: Money to Decimal conversion.
Next
From: rhaas@postgresql.org (Robert Haas)
Date:
Subject: pgsql: Export ExplainBeginOutput() and ExplainEndOutput() for