48
48
Typical output from <application>pgbench</application> looks like:
49
49
50
50
<screen>
51
- transaction type: TPC-B (sort of)
51
+ transaction type: <builtin: TPC-B (sort of)>
52
52
scaling factor: 10
53
53
query mode: simple
54
54
number of clients: 10
@@ -261,6 +261,20 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
261
261
benchmarking arguments:
262
262
263
263
<variablelist>
264
+ <varlistentry>
265
+ <term><option>-b</> <replaceable>scriptname</></term>
266
+ <term><option>--builtin</> <replaceable>scriptname</></term>
267
+ <listitem>
268
+ <para>
269
+ Add the specified builtin script to the list of executed scripts.
270
+ Available builtin scripts are: <literal>tpcb-like</>,
271
+ <literal>simple-update</> and <literal>select-only</>.
272
+ With special name <literal>list</>, show the list of builtin scripts
273
+ and exit immediately.
274
+ </para>
275
+ </listitem>
276
+ </varlistentry>
277
+
264
278
265
279
<varlistentry>
266
280
<term><option>-c</option> <replaceable>clients</></term>
@@ -307,14 +321,13 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
307
321
</varlistentry>
308
322
309
323
<varlistentry>
310
- <term><option>-f</option > <replaceable>filename</></term>
311
- <term><option>--file=</option ><replaceable>filename</></term>
324
+ <term><option>-f</> <replaceable>filename</></term>
325
+ <term><option>--file=</><replaceable>filename</></term>
312
326
<listitem>
313
327
<para>
314
- Read transaction script from <replaceable>filename</>.
328
+ Add a transaction script read from <replaceable>filename</> to
329
+ the list of executed scripts.
315
330
See below for details.
316
- <option>-N</option>, <option>-S</option>, and <option>-f</option>
317
- are mutually exclusive.
318
331
</para>
319
332
</listitem>
320
333
</varlistentry>
@@ -404,10 +417,8 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
404
417
<term><option>--skip-some-updates</option></term>
405
418
<listitem>
406
419
<para>
407
- Do not update <structname>pgbench_tellers</> and
408
- <structname>pgbench_branches</>.
409
- This will avoid update contention on these tables, but
410
- it makes the test case even less like TPC-B.
420
+ Run builtin simple-update script.
421
+ Shorthand for <option>-b simple-update</>.
411
422
</para>
412
423
</listitem>
413
424
</varlistentry>
@@ -512,9 +523,9 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
512
523
Report the specified scale factor in <application>pgbench</>'s
513
524
output. With the built-in tests, this is not necessary; the
514
525
correct scale factor will be detected by counting the number of
515
- rows in the <structname>pgbench_branches</> table. However, when testing
516
- custom benchmarks (<option>-f</> option), the scale factor
517
- will be reported as 1 unless this option is used.
526
+ rows in the <structname>pgbench_branches</> table.
527
+ However, when testing only custom benchmarks (<option>-f</> option),
528
+ the scale factor will be reported as 1 unless this option is used.
518
529
</para>
519
530
</listitem>
520
531
</varlistentry>
@@ -524,7 +535,8 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
524
535
<term><option>--select-only</option></term>
525
536
<listitem>
526
537
<para>
527
- Perform select-only transactions instead of TPC-B-like test.
538
+ Run built-in select-only script.
539
+ Shorthand for <option>-b select-only</>.
528
540
</para>
529
541
</listitem>
530
542
</varlistentry>
@@ -674,7 +686,17 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
674
686
<title>What is the <quote>Transaction</> Actually Performed in <application>pgbench</application>?</title>
675
687
676
688
<para>
677
- The default transaction script issues seven commands per transaction:
689
+ Pgbench executes test scripts chosen randomly from a specified list.
690
+ They include built-in scripts with <option>-b</> and
691
+ user-provided custom scripts with <option>-f</>.
692
+ </para>
693
+
694
+ <para>
695
+ The default builtin transaction script (also invoked with <option>-b tpcb-like</>)
696
+ issues seven commands per transaction over randomly chosen <literal>aid</>,
697
+ <literal>tid</>, <literal>bid</> and <literal>balance</>.
698
+ The scenario is inspired by the TPC-B benchmark, but is not actually TPC-B,
699
+ hence the name.
678
700
</para>
679
701
680
702
<orderedlist>
@@ -688,9 +710,15 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
688
710
</orderedlist>
689
711
690
712
<para>
691
- If you specify <option>-N</>, steps 4 and 5 aren't included in the
692
- transaction. If you specify <option>-S</>, only the <command>SELECT</> is
693
- issued.
713
+ If you select the <literal>simple-update</> builtin (also <option>-N</>),
714
+ steps 4 and 5 aren't included in the transaction.
715
+ This will avoid update contention on these tables, but
716
+ it makes the test case even less like TPC-B.
717
+ </para>
718
+
719
+ <para>
720
+ If you select the <literal>select-only</> builtin (also <option>-S</>),
721
+ only the <command>SELECT</> is issued.
694
722
</para>
695
723
</refsect2>
696
724
@@ -702,10 +730,7 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
702
730
benchmark scenarios by replacing the default transaction script
703
731
(described above) with a transaction script read from a file
704
732
(<option>-f</option> option). In this case a <quote>transaction</>
705
- counts as one execution of a script file. You can even specify
706
- multiple scripts (multiple <option>-f</option> options), in which
707
- case a random one of the scripts is chosen each time a client session
708
- starts a new transaction.
733
+ counts as one execution of a script file.
709
734
</para>
710
735
711
736
<para>
@@ -1103,7 +1128,7 @@ END;
1103
1128
For the default script, the output will look similar to this:
1104
1129
<screen>
1105
1130
starting vacuum...end.
1106
- transaction type: TPC-B (sort of)
1131
+ transaction type: <builtin: TPC-B (sort of)>
1107
1132
scaling factor: 1
1108
1133
query mode: simple
1109
1134
number of clients: 10
@@ -1112,7 +1137,8 @@ number of transactions per client: 1000
1112
1137
number of transactions actually processed: 10000/10000
1113
1138
tps = 618.764555 (including connections establishing)
1114
1139
tps = 622.977698 (excluding connections establishing)
1115
- statement latencies in milliseconds:
1140
+ SQL script 1: <builtin: TPC-B (sort of)>
1141
+ - statement latencies in milliseconds:
1116
1142
0.004386 \set nbranches 1 * :scale
1117
1143
0.001343 \set ntellers 10 * :scale
1118
1144
0.001212 \set naccounts 100000 * :scale
0 commit comments