Re: [HACKERS] pgbench - minor doc improvements

2016-08-24 Thread Fabien COELHO



I looked at this, but I don't really find any of these changes to be
improvements.  They just make it harder to read IMO.


I marked the patch as rejected in CF 2016-09.

--
Fabien.


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] pgbench - minor doc improvements

2016-08-19 Thread Tom Lane
Fabien COELHO  writes:
> Minor pgbench documentation improvements so that the description is more
> precise:
>   - a pgbench script may not contain SQL commands, it only needs not to be
> empty.
>   - point out explicitely variable setting meta commands.
>   - the formula is short enough to fit on a line.

I looked at this, but I don't really find any of these changes to be
improvements.  They just make it harder to read IMO.

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] pgbench - minor doc improvements

2016-07-10 Thread Fabien COELHO


Hello Michaƫl,


Minor pgbench documentation improvements so that the description is more
precise:

 - a pgbench script may not contain SQL commands, it only needs not to be
   empty.


Halfly true as far as I recall. This works and generates two queries:
SELECT 1; \set two 3


Maybe it used to work, but not anymore:

  client 0 aborted in state 0: ERROR:  syntax error at or near "\"
  LINE 1: SELECT 1 ; \set two 3


 - point out explicitely variable setting meta commands.
 - the formula is short enough to fit on a line.



-f(x) = PHI(2.0 * parameter * (x - mu) / (max - min + 1)) /
-   (2.0 * PHI(parameter) - 1)
+f(x) = PHI(2.0 * parameter * (x - mu) / (max - min + 1)) / (2.0 *
PHI(parameter) - 1)
At full-length this is 85 characters.


I agree on principle, however the issue is the "literal layout", the line 
is also broken in the resulting HTML and it looks pretty strange there:


  https://www.postgresql.org/docs/devel/static/pgbench.html

But I agree that it is more readable to put that into a single line. Now 
we could as well trick the limit by using "param" instead of 
"parameter".


ISTM that it would mean changing the text in a dozen places to be 
consistent, and it would not necessary be an improvement in some of those 
places... So I'm hesitant to follow on that suggestion. For me the "under 
80 column" rule cannot really apply on a "literal layout" block.


--
Fabien.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] pgbench - minor doc improvements

2016-07-10 Thread Michael Paquier
On Sat, Jul 9, 2016 at 4:48 PM, Fabien COELHO  wrote:
>
> Minor pgbench documentation improvements so that the description is more
> precise:
>
>  - a pgbench script may not contain SQL commands, it only needs not to be
>empty.

Halfly true as far as I recall. This works and generates two queries:
SELECT 1; \set two 3
SELECT :two;
But any query added after the meta-command cannot be parsed.

>  - point out explicitely variable setting meta commands.
>  - the formula is short enough to fit on a line.

 
-f(x) = PHI(2.0 * parameter * (x - mu) / (max - min + 1)) /
-   (2.0 * PHI(parameter) - 1)
+f(x) = PHI(2.0 * parameter * (x - mu) / (max - min + 1)) / (2.0 *
PHI(parameter) - 1)
At full-length this is 85 characters. But I agree that it is more
readable to put that into a single line. Now we could as well trick
the limit by using "param" instead of "parameter".
-- 
Michael


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] pgbench - minor doc improvements

2016-07-09 Thread Fabien COELHO


Minor pgbench documentation improvements so that the description is more
precise:

 - a pgbench script may not contain SQL commands, it only needs not to be
   empty.

 - point out explicitely variable setting meta commands.

 - the formula is short enough to fit on a line.

--
Fabien.diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index f3afedb..8224417 100644
--- a/doc/src/sgml/ref/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -744,11 +744,10 @@ pgbench  options  dbname
   
 
   
-   A script file contains one or more SQL commands terminated by
-   semicolons.  Empty lines and lines beginning with
-   -- are ignored.  Script files can also contain
-   meta commands, which are interpreted by pgbench
-   itself, as described below.
+   A script file contains one or more commands, which are either SQL commands
+   terminated by semicolons or meta commands interpreted by
+   pgbench itself, as described below.
+   Empty lines and lines beginning with -- are ignored.
   
 
   
@@ -766,13 +765,13 @@ pgbench  options  dbname
   
There is a simple variable-substitution facility for script files.
Variables can be set by the command-line -D option,
-   explained above, or by the meta commands explained below.
+   explained above, or by meta commands \set and
+   \setshell explained below.
In addition to any variables preset by -D command-line options,
there are a few variables that are preset automatically, listed in
. A value specified for these
variables using -D takes precedence over the automatic presets.
-   Once set, a variable's
-   value can be inserted into a SQL command by writing
+   Once set, a variable's value can be inserted into a SQL command by writing
:variablename.  When running more than
one client session, each session has its own set of variables.
   
@@ -1064,8 +1063,7 @@ f(x) = exp(-parameter * (x - min) / (max - min + 1)) / (1 - exp(-parameter))
   function of the standard normal distribution, with mean mu
   defined as (max + min) / 2.0, with
 
-f(x) = PHI(2.0 * parameter * (x - mu) / (max - min + 1)) /
-   (2.0 * PHI(parameter) - 1)
+f(x) = PHI(2.0 * parameter * (x - mu) / (max - min + 1)) / (2.0 * PHI(parameter) - 1)
 
   then value i between min and
   max inclusive is drawn with probability:

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers