summaryrefslogtreecommitdiff
path: root/contrib/pgbench/pgbench.c
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2006-10-21 06:31:28 +0000
committerTatsuo Ishii <ishii@postgresql.org>2006-10-21 06:31:28 +0000
commita5007d671afe5d0c42782db0670879fbc1ccbfb7 (patch)
treefc41abb3b92cee2a6ea10a5cb5f75bef32b997e1 /contrib/pgbench/pgbench.c
parent554032b3e4c2b7f7e07d3d4cd5c8346247ae9587 (diff)
downloadpostgresql-a5007d671afe5d0c42782db0670879fbc1ccbfb7.tar.gz
pgbench: More fix with handling default scaling factor in the default
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.
Diffstat (limited to 'contrib/pgbench/pgbench.c')
-rw-r--r--contrib/pgbench/pgbench.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index 3c15346e89..e880f638f0 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -1,5 +1,5 @@
/*
- * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.57 2006/10/07 19:25:28 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.58 2006/10/21 06:31:28 ishii Exp $
*
* pgbench: a simple benchmark program for PostgreSQL
* written by Tatsuo Ishii
@@ -1352,6 +1352,8 @@ main(int argc, char **argv)
memset(state + 1, 0, sizeof(*state) * (nclients - 1));
+ snprintf(val, sizeof(val), "%d", scale);
+
for (i = 1; i < nclients; i++)
{
int j;
@@ -1364,6 +1366,12 @@ main(int argc, char **argv)
exit(1);
}
}
+
+ if (putVariable(&state[i], "scale", val) == false)
+ {
+ fprintf(stderr, "Couldn't allocate memory for variable\n");
+ exit(1);
+ }
}
}
@@ -1425,6 +1433,18 @@ main(int argc, char **argv)
fprintf(stderr, "Couldn't allocate memory for variable\n");
exit(1);
}
+
+ if (nclients > 1)
+ {
+ for (i = 1; i < nclients; i++)
+ {
+ if (putVariable(&state[i], "scale", val) == false)
+ {
+ fprintf(stderr, "Couldn't allocate memory for variable\n");
+ exit(1);
+ }
+ }
+ }
}
if (!is_no_vacuum)