diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c index 1303217086e7878291dc3c96630733d959a683a0..d464ef5efabbd0944a712c3eece51b041bbbca1d 100644 --- a/contrib/pgbench/pgbench.c +++ b/contrib/pgbench/pgbench.c @@ -329,48 +329,45 @@ usage(void) "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 .\n", progname, progname); @@ -2109,6 +2106,30 @@ int 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}, diff --git a/doc/src/sgml/pgbench.sgml b/doc/src/sgml/pgbench.sgml index 8775606affaeb2a20c9eda2b1cafa3a0e38f1681..a7f41e1243f129172b308e40d5934aac4e85dfac 100644 --- a/doc/src/sgml/pgbench.sgml +++ b/doc/src/sgml/pgbench.sgml @@ -150,6 +150,7 @@ pgbench options dbname + Required to invoke initialization mode. @@ -159,6 +160,7 @@ pgbench options dbname fillfactor + fillfactor Create the pgbench_accounts, @@ -171,6 +173,7 @@ pgbench options dbname + Perform no vacuuming after initialization. @@ -180,6 +183,7 @@ pgbench options dbname + Switch logging to quiet mode, producing only one progress message per 5 @@ -191,6 +195,7 @@ pgbench options dbname scale_factor + scale_factor Multiply the number of rows generated by the scale factor. @@ -259,6 +264,7 @@ pgbench options dbname clients + clients Number of clients simulated, that is, number of concurrent database @@ -269,6 +275,7 @@ pgbench options dbname + Establish a new connection for each transaction, rather than @@ -280,6 +287,7 @@ pgbench options dbname + Print debugging output. @@ -289,6 +297,7 @@ pgbench options dbname varname=value + varname=value Define a variable for use by a custom script (see below). @@ -299,6 +308,7 @@ pgbench options dbname filename + filename Read transaction script from filename. @@ -311,6 +321,7 @@ pgbench options dbname threads + threads Number of worker threads within pgbench. @@ -324,6 +335,7 @@ pgbench options dbname + Write the time taken by each transaction to a log file. @@ -334,6 +346,7 @@ pgbench options dbname querymode + querymode Protocol to use for submitting queries to the server: @@ -356,6 +369,7 @@ pgbench options dbname + Perform no vacuuming before running the test. @@ -370,6 +384,7 @@ pgbench options dbname + Do not update pgbench_tellers and @@ -382,6 +397,7 @@ pgbench options dbname + Report the average per-statement latency (execution time from the @@ -393,6 +409,7 @@ pgbench options dbname scale_factor + scale_factor Report the specified scale factor in pgbench's @@ -407,6 +424,7 @@ pgbench options dbname + Perform select-only transactions instead of TPC-B-like test. @@ -416,6 +434,7 @@ pgbench options dbname transactions + transactions Number of transactions each client runs. Default is 10. @@ -425,6 +444,7 @@ pgbench options dbname seconds + seconds Run the test for this many seconds, rather than a fixed number of @@ -436,6 +456,7 @@ pgbench options dbname + Vacuum all four standard tables before running the test. @@ -495,6 +516,7 @@ pgbench options dbname hostname + hostname The database server's host name @@ -504,6 +526,7 @@ pgbench options dbname port + port The database server's port number @@ -513,6 +536,7 @@ pgbench options dbname login + login The user name to connect as