pgbench hard coded constants

Started by Jeff Janesover 16 years ago3 messageshackers
Jump to latest
#1Jeff Janes
jeff.janes@gmail.com

pgbench has #defines for number of branches, tellers, and accounts. There
are used to populate the tables with -i, but when running actual benchmark
it has values separately hard-coded in the query metacommands. This patch
makes the metacommands obtain their values from the relevant #defines.

It has been tested to the extent that after changing the #define naccounts
downward, without the patch, after running both -i once and the benchmark
itself once leads to inconsistent results (select sum(abalance) from
pgbench_accounts does not equal sum(delta) from pgbench_history), while
with the patch they are equal.

Cheers,

Jeff

Attachments:

pgbench.patchtext/x-diff; charset=US-ASCII; name=pgbench.patchDownload+16-16
#2Tatsuo Ishii
t-ishii@sra.co.jp
In reply to: Jeff Janes (#1)
Re: pgbench hard coded constants

pgbench has #defines for number of branches, tellers, and accounts. There
are used to populate the tables with -i, but when running actual benchmark
it has values separately hard-coded in the query metacommands. This patch
makes the metacommands obtain their values from the relevant #defines.

Good catch! Long standing bug...

It has been tested to the extent that after changing the #define naccounts
downward, without the patch, after running both -i once and the benchmark
itself once leads to inconsistent results (select sum(abalance) from
pgbench_accounts does not equal sum(delta) from pgbench_history), while
with the patch they are equal.

Looks good. If there's no objection, I will commit into CVS HEAD.
--
Tatsuo Ishii
SRA OSS, Inc. Japan

#3Tatsuo Ishii
t-ishii@sra.co.jp
In reply to: Tatsuo Ishii (#2)
Re: pgbench hard coded constants

pgbench has #defines for number of branches, tellers, and accounts. There
are used to populate the tables with -i, but when running actual benchmark
it has values separately hard-coded in the query metacommands. This patch
makes the metacommands obtain their values from the relevant #defines.

Good catch! Long standing bug...

It has been tested to the extent that after changing the #define naccounts
downward, without the patch, after running both -i once and the benchmark
itself once leads to inconsistent results (select sum(abalance) from
pgbench_accounts does not equal sum(delta) from pgbench_history), while
with the patch they are equal.

Looks good. If there's no objection, I will commit into CVS HEAD.

Done. Thanks Jeff!
--
Tatsuo Ishii
SRA OSS, Inc. Japan