summaryrefslogtreecommitdiff
path: root/contrib/pgbench/pgbench.c
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2009-09-10 13:59:57 +0000
committerTatsuo Ishii <ishii@postgresql.org>2009-09-10 13:59:57 +0000
commitf82d4d53020d2cb2444ea3ee18fe5a17fc2d73e7 (patch)
treec0de660de3e8a58b6f35fde9d6c85eae2e939574 /contrib/pgbench/pgbench.c
parent4e2d5efc6a45b1f9f96df42629f6d1c7740e657e (diff)
downloadpostgresql-f82d4d53020d2cb2444ea3ee18fe5a17fc2d73e7.tar.gz
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. Patch provided by Jeff Janes.
Diffstat (limited to 'contrib/pgbench/pgbench.c')
-rw-r--r--contrib/pgbench/pgbench.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index aafc64e3ce..d41a87cfea 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -4,7 +4,7 @@
* A simple benchmark program for PostgreSQL
* Originally written by Tatsuo Ishii and enhanced by many contributors.
*
- * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.90 2009/08/03 18:30:55 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.91 2009/09/10 13:59:57 ishii Exp $
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
@@ -132,7 +132,7 @@ int fillfactor = 100;
* end of configurable parameters
*********************************************************************/
-#define nbranches 1
+#define nbranches 1 /* Makes little sense to change this. Change -s instead */
#define ntellers 10
#define naccounts 100000
@@ -232,9 +232,9 @@ static int debug = 0; /* debug flag */
/* default scenario */
static char *tpc_b = {
- "\\set nbranches :scale\n"
- "\\set ntellers 10 * :scale\n"
- "\\set naccounts 100000 * :scale\n"
+ "\\set nbranches " CppAsString2(nbranches) " * :scale\n"
+ "\\set ntellers " CppAsString2(ntellers) " * :scale\n"
+ "\\set naccounts " CppAsString2(naccounts) " * :scale\n"
"\\setrandom aid 1 :naccounts\n"
"\\setrandom bid 1 :nbranches\n"
"\\setrandom tid 1 :ntellers\n"
@@ -250,9 +250,9 @@ static char *tpc_b = {
/* -N case */
static char *simple_update = {
- "\\set nbranches :scale\n"
- "\\set ntellers 10 * :scale\n"
- "\\set naccounts 100000 * :scale\n"
+ "\\set nbranches " CppAsString2(nbranches) " * :scale\n"
+ "\\set ntellers " CppAsString2(ntellers) " * :scale\n"
+ "\\set naccounts " CppAsString2(naccounts) " * :scale\n"
"\\setrandom aid 1 :naccounts\n"
"\\setrandom bid 1 :nbranches\n"
"\\setrandom tid 1 :ntellers\n"
@@ -266,7 +266,7 @@ static char *simple_update = {
/* -S case */
static char *select_only = {
- "\\set naccounts 100000 * :scale\n"
+ "\\set naccounts " CppAsString2(naccounts) " * :scale\n"
"\\setrandom aid 1 :naccounts\n"
"SELECT abalance FROM pgbench_accounts WHERE aid = :aid;\n"
};