Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf82d4d5

Browse files
committed
pgbench has #defines for number of branches, tellers, and accounts. There
are used to populate the tables with -i, but when running actual benchmarkit has values separately hard-coded in the query metacommands. This patchmakes the metacommands obtain their values from the relevant #defines.Patch provided by Jeff Janes.
1 parent4e2d5ef commitf82d4d5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

‎contrib/pgbench/pgbench.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* A simple benchmark program for PostgreSQL
55
* Originally written by Tatsuo Ishii and enhanced by many contributors.
66
*
7-
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.90 2009/08/03 18:30:55 tgl Exp $
7+
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.91 2009/09/10 13:59:57 ishii Exp $
88
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
99
* ALL RIGHTS RESERVED;
1010
*
@@ -132,7 +132,7 @@ intfillfactor = 100;
132132
* end of configurable parameters
133133
*********************************************************************/
134134

135-
#definenbranches1
135+
#definenbranches1/* Makes little sense to change this. Change -s instead */
136136
#definentellers10
137137
#definenaccounts100000
138138

@@ -232,9 +232,9 @@ static intdebug = 0;/* debug flag */
232232

233233
/* default scenario */
234234
staticchar*tpc_b= {
235-
"\\set nbranches :scale\n"
236-
"\\set ntellers10 * :scale\n"
237-
"\\set naccounts100000 * :scale\n"
235+
"\\set nbranches"CppAsString2(nbranches)" *:scale\n"
236+
"\\set ntellers"CppAsString2(ntellers)" * :scale\n"
237+
"\\set naccounts"CppAsString2(naccounts)" * :scale\n"
238238
"\\setrandom aid 1 :naccounts\n"
239239
"\\setrandom bid 1 :nbranches\n"
240240
"\\setrandom tid 1 :ntellers\n"
@@ -250,9 +250,9 @@ static char *tpc_b = {
250250

251251
/* -N case */
252252
staticchar*simple_update= {
253-
"\\set nbranches :scale\n"
254-
"\\set ntellers10 * :scale\n"
255-
"\\set naccounts100000 * :scale\n"
253+
"\\set nbranches"CppAsString2(nbranches)" *:scale\n"
254+
"\\set ntellers"CppAsString2(ntellers)" * :scale\n"
255+
"\\set naccounts"CppAsString2(naccounts)" * :scale\n"
256256
"\\setrandom aid 1 :naccounts\n"
257257
"\\setrandom bid 1 :nbranches\n"
258258
"\\setrandom tid 1 :ntellers\n"
@@ -266,7 +266,7 @@ static char *simple_update = {
266266

267267
/* -S case */
268268
staticchar*select_only= {
269-
"\\set naccounts100000 * :scale\n"
269+
"\\set naccounts"CppAsString2(naccounts)" * :scale\n"
270270
"\\setrandom aid 1 :naccounts\n"
271271
"SELECT abalance FROM pgbench_accounts WHERE aid = :aid;\n"
272272
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp