From 7bafffea647e21864cb857ab5b6fe266f2d0976a Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Sat, 19 Mar 2016 12:32:42 -0300 Subject: pgbench: Allow changing weights for scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, all scripts had the same probability of being chosen when multiple of them were specified via -b, -f, -N, -S. With this commit, -b and -f now search for an "@" in the script name and use the integer found after it as the drawing probability for that script. (One disadvantage is that if you have script whose names contain @, you are now forced to specify "@1" at the end; otherwise the name's @ is confused with a weight separator. We don't expect many pgbench script with @ in their names in the wild, so this shouldn't be too serious a problem.) While at it, rework the interface between addScript, process_file, process_builtin, and findBuiltin. It had gotten a bit out of hand with recent commits. Author: Fabien Coelho Reviewed-By: Andres Freund, Robert Haas, Álvaro Herrera, Michaël Paquier Discussion: http://www.postgresql.org/message-id/alpine.DEB.2.10.1603160721240.1666@sto --- doc/src/sgml/ref/pgbench.sgml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index cc80b3fc4f5..dd3fb1dce0f 100644 --- a/doc/src/sgml/ref/pgbench.sgml +++ b/doc/src/sgml/ref/pgbench.sgml @@ -262,11 +262,13 @@ pgbench options dbname - - + + Add the specified builtin script to the list of executed scripts. + An optional integer weight after @ allows to adjust the + probability of drawing the script. If not specified, it is set to 1. Available builtin scripts are: tpcb-like, simple-update and select-only. Unambiguous prefixes of builtin names are accepted. @@ -322,12 +324,14 @@ pgbench options dbname - - + + Add a transaction script read from filename to the list of executed scripts. + An optional integer weight after @ allows to adjust the + probability of drawing the test. See below for details. @@ -687,9 +691,13 @@ pgbench options dbname What is the <quote>Transaction</> Actually Performed in <application>pgbench</application>? - Pgbench executes test scripts chosen randomly from a specified list. + pgbench executes test scripts chosen randomly + from a specified list. They include built-in scripts with @@ -1194,12 +1202,11 @@ number of clients: 10 number of threads: 1 number of transactions per client: 1000 number of transactions actually processed: 10000/10000 +latency average = 15.844 ms +latency stddev = 2.715 ms tps = 618.764555 (including connections establishing) tps = 622.977698 (excluding connections establishing) -SQL script 1: <builtin: TPC-B (sort of)> - - 10000 transactions (100.0% of total, tps = 618.764555) - - latency average = 15.844 ms - - latency stddev = 2.715 ms +script statistics: - statement latencies in milliseconds: 0.004386 \set nbranches 1 * :scale 0.001343 \set ntellers 10 * :scale -- cgit v1.2.3