@@ -68,11 +68,10 @@ tps = 85.296346 (excluding connections establishing)
68
68
and number of transactions per client); these will be equal unless the run
69
69
failed before completion. (In <option>-T</> mode, only the actual
70
70
number of transactions is printed.)
71
- The next two lines report the number of
72
- transactions with serialization and deadlock failures; unlike other errors
73
- transactions with these ones don't fail and continue run normally, but
74
- transaction result is rolled back.
75
- And the last two lines report the number of transactions per second,
71
+ The next two lines report the number of transactions with serialization and
72
+ deadlock failures. With such errors, transactions do not fail and continue
73
+ running normally, but the transaction result is rolled back.
74
+ The last two lines report the number of transactions per second,
76
75
figured with and without counting the time to start database sessions.
77
76
</para>
78
77
@@ -345,25 +344,24 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
345
344
</varlistentry>
346
345
347
346
<varlistentry>
348
- <term><option>-I</option> <replaceable>isolationlevel </></term>
349
- <term><option>--default-isolation-level=</option><replaceable>isolationlevel </></term>
347
+ <term><option>-I</option> <replaceable>isolation_level </></term>
348
+ <term><option>--default-isolation-level=</option><replaceable>isolation_level </></term>
350
349
<listitem>
351
350
<para>
352
- Set default transaction isolation level. Use next abbreviations for
353
- <replaceable>isolationlevel</>:
351
+ Set the default transaction isolation level:
354
352
<itemizedlist>
355
353
<listitem>
356
- <para><literal>RC</>:set default transaction isolation level as Read Committed. </para>
354
+ <para><literal>RC</>: Read Committed</para>
357
355
</listitem>
358
356
<listitem>
359
- <para><literal>RR</>:set default transaction isolation level as Repeatable Read. </para>
357
+ <para><literal>RR</>: Repeatable Read</para>
360
358
</listitem>
361
359
<listitem>
362
- <para><literal>S</>:set default transaction isolation level as Serializable. </para>
360
+ <para><literal>S</>: Serializable</para>
363
361
</listitem>
364
362
</itemizedlist>
365
- The default is Read Committed isolation level.(See
366
- <xref linkend="transaction-iso"> for more information.)
363
+ By default, Read Committed isolation level is used .For more
364
+ information, see <xref linkend="transaction-iso">.
367
365
</para>
368
366
</listitem>
369
367
</varlistentry>
@@ -465,13 +463,13 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
465
463
<listitem>
466
464
<para>
467
465
Show progress report every <replaceable>sec</> seconds. The report
468
- includes the time since the beginning of the run andnext
469
- characteristics since the last report: the tps, the number of
470
- transactions with serialization and deadlock failures, and the
471
- transaction latency average and standard deviation. Under throttling
472
- (<option>-R</>), the latency is computed with respect to the transaction
473
- scheduled start time, not the actual transaction beginning time, thus it
474
- also includes the average schedule lag time.
466
+ includes the time since the beginning of the run andthe following
467
+ statistics since the last report: the tps, the number of transactions
468
+ with serialization and deadlock failures, and the transaction latency
469
+ average and standard deviation. Under throttling (<option>-R</>), the
470
+ latency is computed with respect to the transaction scheduled start
471
+ time, not the actual transaction beginning time, thus it also includes
472
+ the average schedule lag time.
475
473
</para>
476
474
</listitem>
477
475
</varlistentry>
@@ -483,9 +481,11 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
483
481
<para>
484
482
Report the average per-statement latency (execution time from the
485
483
perspective of the client) of each command after the benchmark
486
- finishes (with the number of serialization and deadlock failures for
487
- each command if it is used with <option>--report-failures</> option).
488
- See below for details.
484
+ finishes. You can use this option together with the
485
+ <option>--report-failures</> option to get the number of serialization
486
+ and deadlock failures for each command.
487
+ For details, see <xref linkend="per-statement-latencies-failures"
488
+ endterm="per-statement-latencies-failures-title">.
489
489
</para>
490
490
</listitem>
491
491
</varlistentry>
@@ -644,9 +644,11 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
644
644
<listitem>
645
645
<para>
646
646
Report the number of serialization and deadlock failures for each
647
- command after the benchmark finishes (with the average per-statement
648
- latencies of each command if it is used with <option>-r</> option). See
649
- below for details.
647
+ command after the benchmark finishes. You can use this option together
648
+ with the <option>--report-latencies</> option to get the average
649
+ per-statement latencies of each command.
650
+ For details, see <xref linkend="per-statement-latencies-failures"
651
+ endterm="per-statement-latencies-failures-title">.
650
652
</para>
651
653
</listitem>
652
654
</varlistentry>
@@ -1218,14 +1220,19 @@ END;
1218
1220
When both <option>--rate</> and <option>--latency-limit</> are used,
1219
1221
the <replaceable>time</> for a skipped transaction will be reported as
1220
1222
<literal>skipped</>.
1221
- If transaction has serialization / deadlock failure or them both (last thing
1222
- is possible if used script contains several transactions; see
1223
- <xref linkend="transactions-and-scripts"
1224
- endterm="transactions-and-scripts-title"> for more information), its
1225
- <replaceable>time</> will be reported as <literal>serialization failure</> /
1226
- <literal>deadlock failure</> /
1227
- <literal>serialization and deadlock failures</> appropriately.
1223
+ If a transaction has serialization and/or deadlock failures, its
1224
+ <replaceable>time</> will be reported as <literal>serialization failure</>,
1225
+ <literal>deadlock failure</>, or
1226
+ <literal>serialization and deadlock failures</>, respectively.
1228
1227
</para>
1228
+ <note>
1229
+ <para>
1230
+ Transactions can have both serialization and deadlock failures if the
1231
+ used script contained several transactions. See
1232
+ <xref linkend="transactions-and-scripts"
1233
+ endterm="transactions-and-scripts-title"> for more information.
1234
+ </para>
1235
+ </note>
1229
1236
1230
1237
<para>
1231
1238
Here is a snippet of the log file generated:
@@ -1253,7 +1260,7 @@ END;
1253
1260
</para>
1254
1261
1255
1262
<para>
1256
- Example with serialization, deadlock andboth these failures:
1263
+ Example with serialization anddeadlock failures:
1257
1264
<screen>
1258
1265
1 128 24968 0 1496759158 426984
1259
1266
0 129 serialization failure 0 1496759158 427023
@@ -1287,7 +1294,7 @@ END;
1287
1294
format time stamp), <replaceable>num_of_transactions</> is the number of transactions
1288
1295
within the interval, <replaceable>num_serialization_failures_transactions</>
1289
1296
and <replaceable>num_deadlock_failures_transactions</> are the numbers of
1290
- transactions withappropriate failures within the interval, <replaceable>
1297
+ transactions withthe corresponding failures within the interval, <replaceable>
1291
1298
latency_sum</replaceable> is a sum of latencies (so you can compute average
1292
1299
latency easily). The following two fields are useful for variance estimation
1293
1300
- <replaceable>latency_sum</> is a sum of latencies and <replaceable>
@@ -1322,27 +1329,42 @@ END;
1322
1329
1323
1330
</refsect2>
1324
1331
1325
- <refsect2>
1326
- <title>Per-Statement Latencies and Failures</title>
1332
+ <refsect2 id="per-statement-latencies-failures" >
1333
+ <title id="per-statement-latencies-failures-title" >Per-Statement Latencies and Failures</title>
1327
1334
1328
1335
<para>
1329
- There're two options to get some per-statement characteristics: <option>-r</>
1330
- and <option>--report-failures</> (they can be combined together). All values
1331
- are computed for each statement executed by every client and are reported
1332
- after the benchmark has finished. With the <option>-r</> option,
1333
- <application>pgbench</> collects the elapsed transaction time of each
1334
- statement. It then reports an average of those values, referred to as the
1335
- latency for each statement. With the <option>--report-failures</> option,
1336
- <application>pgbench</> collects the number of serialization and deadlock
1337
- failures for each statement (notice that the total sum of per-command
1338
- failures of each type can be greater than the number of "transactions" with
1339
- these failures; see <xref linkend="transactions-and-scripts"
1340
- endterm="transactions-and-scripts-title"> for more information).
1336
+ To get per-statement statistics, you can use the following options:
1337
+ <itemizedlist>
1338
+ <listitem>
1339
+ <para>
1340
+ <option>--report-latencies</> — collects the elapsed transaction
1341
+ time of each statement and reports an average of those values, referred
1342
+ to as the latency for each statement.
1343
+ </para>
1344
+ </listitem>
1345
+ <listitem>
1346
+ <para>
1347
+ <option>--report-failures</> — collects the number of
1348
+ serialization and deadlock failures for each statement.
1349
+ </para>
1350
+ <note>
1351
+ <para>The total sum of per-command failures of each type can be greater
1352
+ than the number of transactions with reported failures.
1353
+ See <xref linkend="transactions-and-scripts"
1354
+ endterm="transactions-and-scripts-title"> for more information.
1355
+ </para>
1356
+ </note>
1357
+ </listitem>
1358
+ </itemizedlist>
1359
+ All values are computed for each statement executed by every client and are
1360
+ reported after the benchmark has finished. You can use
1361
+ <option>--report-latencies</> and <option>--report-failures</> options
1362
+ together to get a full report.
1341
1363
</para>
1342
1364
1343
1365
<para>
1344
- For the default script if you use <option>-r</> option, the output will look
1345
- similar to this:
1366
+ For the default script, if you usethe <option>-r</> option, the output will
1367
+ look similar to this:
1346
1368
<screen>
1347
1369
starting vacuum...end.
1348
1370
transaction type: <builtin: TPC-B (sort of)>
@@ -1377,7 +1399,8 @@ script statistics:
1377
1399
</screen>
1378
1400
1379
1401
Another example of output for the default script using serializable default
1380
- transaction isolation level (-I S) and <option>--report-failures</> option:
1402
+ transaction isolation level (<option>-I S</option>) and
1403
+ <option>--report-failures</> option:
1381
1404
<screen>
1382
1405
starting vacuum...end.
1383
1406
transaction type: <builtin: TPC-B (sort of)>
@@ -1397,17 +1420,23 @@ script statistics:
1397
1420
- number of transactions with serialization failures: 9284 (92.840%)
1398
1421
- number of transactions with deadlock failures: 0 (0.000%)
1399
1422
- statement serialization and deadlock failures:
1400
- 0 0 \set aid random(1, 100000 * :scale)
1401
- 0 0 \set bid random(1, 1 * :scale)
1402
- 0 0 \set tid random(1, 10 * :scale)
1403
- 0 0 \set delta random(-5000, 5000)
1404
- 0 0 BEGIN;
1405
- 0 0 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
1406
- 0 0 SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
1407
- 7975 0 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
1408
- 1305 0 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
1409
- 0 0 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
1410
- 4 0 END;
1423
+ 0 0 \set aid random(1, 100000 * :scale)
1424
+ 0 0 \set bid random(1, 1 * :scale)
1425
+ 0 0 \set tid random(1, 10 * :scale)
1426
+ 0 0 \set delta random(-5000, 5000)
1427
+ 0 0 BEGIN;
1428
+ 0 0 UPDATE pgbench_accounts
1429
+ SET abalance = abalance + :delta WHERE aid = :aid;
1430
+ 0 0 SELECT abalance FROM pgbench_accounts
1431
+ WHERE aid = :aid;
1432
+ 7975 0 UPDATE pgbench_tellers
1433
+ SET tbalance = tbalance + :delta WHERE tid = :tid;
1434
+ 1305 0 UPDATE pgbench_branches
1435
+ SET bbalance = bbalance + :delta WHERE bid = :bid;
1436
+ 0 0 INSERT INTO pgbench_history
1437
+ (tid, bid, aid, delta, mtime)
1438
+ VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
1439
+ 4 0 END;
1411
1440
</screen>
1412
1441
</para>
1413
1442