Home Explore Blog CI



postgresql

33th chunk of `doc/src/sgml/ref/pgbench.sgml`
0142c08dc5e5391a104914a9af95ac25282ae4a082dc2f140000000100000fa4
 unless <option>--rate</option> is specified)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>min_lag</replaceable></term>
     <listitem>
      <para>
       minimum transaction start delay
       (zero unless <option>--rate</option> is specified)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>max_lag</replaceable></term>
     <listitem>
      <para>
       maximum transaction start delay
       (zero unless <option>--rate</option> is specified)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>skipped</replaceable></term>
     <listitem>
      <para>
       number of transactions skipped because they would have started too late
       (zero unless <option>--rate</option>
       and <option>--latency-limit</option> are specified)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>retried</replaceable></term>
     <listitem>
      <para>
       number of retried transactions
       (zero unless <option>--max-tries</option> is not equal to one)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>retries</replaceable></term>
     <listitem>
      <para>
       number of retries after serialization or deadlock errors
       (zero unless <option>--max-tries</option> is not equal to one)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>serialization_failures</replaceable></term>
     <listitem>
      <para>
       number of transactions that got a serialization error and were not
       retried afterwards
       (zero unless <option>--failures-detailed</option> is specified)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><replaceable>deadlock_failures</replaceable></term>
     <listitem>
      <para>
       number of transactions that got a deadlock error and were not
       retried afterwards
       (zero unless <option>--failures-detailed</option> is specified)
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>

  <para>
   Here is some example output generated with this option:
<screen>
<userinput>pgbench --aggregate-interval=10 --time=20 --client=10 --log --rate=1000 --latency-limit=10 --failures-detailed --max-tries=10 test</userinput>

1650260552 5178 26171317 177284491527 1136 44462 2647617 7321113867 0 9866 64 7564 28340 4148 0
1650260562 4808 25573984 220121792172 1171 62083 3037380 9666800914 0 9998 598 7392 26621 4527 0
</screen>
  </para>

  <para>
   Notice that while the plain (unaggregated) log format shows which script
   was used for each transaction, the aggregated format does not. Therefore if
   you need per-script data, you need to aggregate the data on your own.
  </para>

 </refsect2>

 <refsect2>
  <title>Per-Statement Report</title>

  <para>
   With the <option>-r</option> option, <application>pgbench</application>
   collects the following statistics for each statement:
   <itemizedlist>
     <listitem>
       <para>
         <literal>latency</literal> &mdash; elapsed transaction time for each
         statement. <application>pgbench</application> reports an average value
         of all successful runs of the statement.
       </para>
     </listitem>
     <listitem>
       <para>
         The number of failures in this statement. See
         <xref linkend="failures-and-retries"/> for more information.
       </para>
     </listitem>
     <listitem>
       <para>
         The number of retries after a serialization or a deadlock error in this
         statement. See <xref linkend="failures-and-retries"/> for more information.
       </para>
     </listitem>
   </itemizedlist>
  </para>

  <para>
   The report displays retry statistics only if the <option>--max-tries</option>
   option is not equal to 1.
  </para>

  <para>
   All values are computed for each statement executed

Title: Aggregated Logging Details and Per-Statement Reporting in pgbench
Summary
This section continues detailing aggregated logging in pgbench, explaining the meaning of 'retried', 'retries', 'serialization_failures', and 'deadlock_failures'. It provides an example of aggregated log output generated by pgbench with specific options. It notes that unlike the plain log format, aggregated logs do not show which script was used for each transaction, so users needing per-script data must perform their own aggregation. The section then introduces per-statement reporting using the `-r` option. This collects statistics for each statement, including latency, the number of failures, and the number of retries after serialization or deadlock errors. The retry statistics are displayed only when `--max-tries` is not equal to 1.