"Usage:\n"
" %s [OPTION]... [DBNAME]\n"
"\nInitialization options:\n"
- " -i invokes initialization mode\n"
- " -F NUM fill factor\n"
- " -n do not run VACUUM after initialization\n"
- " -q quiet logging (one message each 5 seconds)\n"
- " -s NUM scaling factor\n"
- " --foreign-keys\n"
- " create foreign key constraints between tables\n"
+ " -i, --initialize invokes initialization mode\n"
+ " -F, --fillfactor=NUM set fill factor\n"
+ " -n, --no-vacuum do not run VACUUM after initialization\n"
+ " -q, --quiet quiet logging (one message each 5 seconds)\n"
+ " -s NUM, --scale NUM scaling factor\n"
+ " --foreign-keys create foreign key constraints between tables\n"
" --index-tablespace=TABLESPACE\n"
- " create indexes in the specified tablespace\n"
- " --tablespace=TABLESPACE\n"
- " create tables in the specified tablespace\n"
- " --unlogged-tables\n"
- " create tables as unlogged tables\n"
+ " create indexes in the specified tablespace\n"
+ " --tablespace=TABLESPACE create tables in the specified tablespace\n"
+ " --unlogged-tables create tables as unlogged tables\n"
"\nBenchmarking options:\n"
- " -c NUM number of concurrent database clients (default: 1)\n"
- " -C establish new connection for each transaction\n"
- " -D VARNAME=VALUE\n"
- " define variable for use by custom script\n"
- " -f FILENAME read transaction script from FILENAME\n"
- " -j NUM number of threads (default: 1)\n"
- " -l write transaction times to log file\n"
- " -M simple|extended|prepared\n"
- " protocol for submitting queries to server (default: simple)\n"
- " -n do not run VACUUM before tests\n"
- " -N do not update tables \"pgbench_tellers\" and \"pgbench_branches\"\n"
- " -r report average latency per command\n"
- " -s NUM report this scale factor in output\n"
- " -S perform SELECT-only transactions\n"
- " -t NUM number of transactions each client runs (default: 10)\n"
- " -T NUM duration of benchmark test in seconds\n"
- " -v vacuum all four standard tables before tests\n"
- " --aggregate-interval=NUM\n"
- " aggregate data over NUM seconds\n"
- " --sampling-rate=NUM\n"
- " fraction of transactions to log (e.g. 0.01 for 1%% sample)\n"
+ " -c, --client=NUM number of concurrent database clients (default: 1)\n"
+ " -C, --connect establish new connection for each transaction\n"
+ " -D, --define=VARNAME=VALUE\n"
+ " define variable for use by custom script\n"
+ " -f, --file=FILENAME read transaction script from FILENAME\n"
+ " -j, --jobs=NUM number of threads (default: 1)\n"
+ " -l, --log write transaction times to log file\n"
+ " -M, --protocol=simple|extended|prepared\n"
+ " protocol for submitting queries "
+ "(default: simple)\n"
+ " -n, --no-vacuum do not run VACUUM before tests\n"
+ " -N, --skip-some-updates skip updates of pgbench_tellers and pgbench_branches\n"
+ " -r, --report-latencies report average latency per command\n"
+ " -s, --scale=NUM report this scale factor in output\n"
+ " -S, --select-only perform SELECT-only transactions\n"
+ " -t, --transactions number of transactions each client runs "
+ "(default: 10)\n"
+ " -T, --time=NUM duration of benchmark test in seconds\n"
+ " -v, --vacuum-all vacuum all four standard tables before tests\n"
+ " --aggregate-interval=NUM aggregate data over NUM seconds\n"
+ " --sampling-rate=NUM fraction of transactions to log (e.g. 0.01 for 1%%)\n"
"\nCommon options:\n"
- " -d print debugging output\n"
- " -h HOSTNAME database server host or socket directory\n"
- " -p PORT database server port number\n"
- " -U USERNAME connect as specified database user\n"
- " -V, --version output version information, then exit\n"
- " -?, --help show this help, then exit\n"
+ " -d, --debug print debugging output\n"
+ " -h, --host=HOSTNAME database server host or socket directory\n"
+ " -p, --port=PORT database server port number\n"
+ " -U, --username=USERNAME connect as specified database user\n"
+ " -V, --version output version information, then exit\n"
+ " -?, --help show this help, then exit\n"
"\n"
"Report bugs to <pgsql-bugs@postgresql.org>.\n",
progname, progname);
main(int argc, char **argv)
{
static struct option long_options[] = {
+ /* systematic long/short named options*/
+ {"client", required_argument, NULL, 'c'},
+ {"connect", no_argument, NULL, 'C'},
+ {"debug", no_argument, NULL, 'd'},
+ {"define", required_argument, NULL, 'D'},
+ {"file", required_argument, NULL, 'f'},
+ {"fillfactor", required_argument, NULL, 'F'},
+ {"host", required_argument, NULL, 'h'},
+ {"initialize", no_argument, NULL, 'i'},
+ {"jobs", required_argument, NULL, 'j'},
+ {"log", no_argument, NULL, 'l'},
+ {"no-vacuum", no_argument, NULL, 'n'},
+ {"port", required_argument, NULL, 'p'},
+ {"protocol", required_argument, NULL, 'M'},
+ {"quiet", no_argument, NULL, 'q'},
+ {"report-latencies", no_argument, NULL, 'r'},
+ {"scale", required_argument, NULL, 's'},
+ {"select-only", no_argument, NULL, 'S'},
+ {"skip-some-updates", no_argument, NULL, 'N'},
+ {"time", required_argument, NULL, 'T'},
+ {"transactions", required_argument, NULL, 't'},
+ {"username", required_argument, NULL, 'U'},
+ {"vacuum-all", no_argument, NULL, 'v'},
+ /* long-named only options */
{"foreign-keys", no_argument, &foreign_keys, 1},
{"index-tablespace", required_argument, NULL, 3},
{"tablespace", required_argument, NULL, 2},
<varlistentry>
<term><option>-i</option></term>
+ <term><option>--initialize</option></term>
<listitem>
<para>
Required to invoke initialization mode.
<varlistentry>
<term><option>-F</option> <replaceable>fillfactor</></term>
+ <term><option>--fillfactor=</option><replaceable>fillfactor</></term>
<listitem>
<para>
Create the <structname>pgbench_accounts</>,
<varlistentry>
<term><option>-n</option></term>
+ <term><option>--no-vacuum</option></term>
<listitem>
<para>
Perform no vacuuming after initialization.
<varlistentry>
<term><option>-q</option></term>
+ <term><option>--quiet</option></term>
<listitem>
<para>
Switch logging to quiet mode, producing only one progress message per 5
<varlistentry>
<term><option>-s</option> <replaceable>scale_factor</></term>
+ <term><option>--scale=</option><replaceable>scale_factor</></term>
<listitem>
<para>
Multiply the number of rows generated by the scale factor.
<varlistentry>
<term><option>-c</option> <replaceable>clients</></term>
+ <term><option>--client=</option><replaceable>clients</></term>
<listitem>
<para>
Number of clients simulated, that is, number of concurrent database
<varlistentry>
<term><option>-C</option></term>
+ <term><option>--connect</option></term>
<listitem>
<para>
Establish a new connection for each transaction, rather than
<varlistentry>
<term><option>-d</option></term>
+ <term><option>--debug</option></term>
<listitem>
<para>
Print debugging output.
<varlistentry>
<term><option>-D</option> <replaceable>varname</><literal>=</><replaceable>value</></term>
+ <term><option>--define=</option><replaceable>varname</><literal>=</><replaceable>value</></term>
<listitem>
<para>
Define a variable for use by a custom script (see below).
<varlistentry>
<term><option>-f</option> <replaceable>filename</></term>
+ <term><option>--file=</option><replaceable>filename</></term>
<listitem>
<para>
Read transaction script from <replaceable>filename</>.
<varlistentry>
<term><option>-j</option> <replaceable>threads</></term>
+ <term><option>--jobs=</option><replaceable>threads</></term>
<listitem>
<para>
Number of worker threads within <application>pgbench</application>.
<varlistentry>
<term><option>-l</option></term>
+ <term><option>--log</option></term>
<listitem>
<para>
Write the time taken by each transaction to a log file.
<varlistentry>
<term><option>-M</option> <replaceable>querymode</></term>
+ <term><option>--protocol=</option><replaceable>querymode</></term>
<listitem>
<para>
Protocol to use for submitting queries to the server:
<varlistentry>
<term><option>-n</option></term>
+ <term><option>--no-vacuum</option></term>
<listitem>
<para>
Perform no vacuuming before running the test.
<varlistentry>
<term><option>-N</option></term>
+ <term><option>--skip-some-updates</option></term>
<listitem>
<para>
Do not update <structname>pgbench_tellers</> and
<varlistentry>
<term><option>-r</option></term>
+ <term><option>--report-latencies</option></term>
<listitem>
<para>
Report the average per-statement latency (execution time from the
<varlistentry>
<term><option>-s</option> <replaceable>scale_factor</></term>
+ <term><option>--scale=</option><replaceable>scale_factor</></term>
<listitem>
<para>
Report the specified scale factor in <application>pgbench</>'s
<varlistentry>
<term><option>-S</option></term>
+ <term><option>--select-only</option></term>
<listitem>
<para>
Perform select-only transactions instead of TPC-B-like test.
<varlistentry>
<term><option>-t</option> <replaceable>transactions</></term>
+ <term><option>--transactions=</option><replaceable>transactions</></term>
<listitem>
<para>
Number of transactions each client runs. Default is 10.
<varlistentry>
<term><option>-T</option> <replaceable>seconds</></term>
+ <term><option>--time=</option><replaceable>seconds</></term>
<listitem>
<para>
Run the test for this many seconds, rather than a fixed number of
<varlistentry>
<term><option>-v</option></term>
+ <term><option>--vacuum-all</option></term>
<listitem>
<para>
Vacuum all four standard tables before running the test.
<varlistentry>
<term><option>-h</option> <replaceable>hostname</></term>
+ <term><option>--host=</option><replaceable>hostname</></term>
<listitem>
<para>
The database server's host name
<varlistentry>
<term><option>-p</option> <replaceable>port</></term>
+ <term><option>--port=</option><replaceable>port</></term>
<listitem>
<para>
The database server's port number
<varlistentry>
<term><option>-U</option> <replaceable>login</></term>
+ <term><option>--username=</option><replaceable>login</></term>
<listitem>
<para>
The user name to connect as