These patches were created during an unrelated discussion about pgbench.

Please see emails [1] - [6] linked below, for the past discussion.

In brief:

>     $ pgbench -i -I dtGvp -s 500

The init-steps are severely under-documented in pgbench --help output.
I think at least a pointer to the the pgbench docs should be mentioned
in the pgbench --help output; an average user may not rush to read the
code to find the explanation, but a hint to where to find more details
about what the letters in --init-steps mean, would save them a lot of
time.

Please see attached 4 variants of the patch. Variant 1 simply tells
the reader to consult pgbench documentation. The second variant
provides a description for each of the letters, as the documentation
does. The committer can pick  the one they find suitable.

The text ", in the specified order" is an important detail, that
should be included irrespective of the rest of the patch.

My preference would be to use the first variant, since the second one
feels too wordy for --help output. I believe we'll have to choose
between these two; the alternatives will not make anyone happy.

These two variants show the two extremes; bare minimum vs. everything
but the kitchen sink. So one may feel the need to find a middle ground
and provide a "sufficient, but not too much" variant. I have attempted
that in variants 3 and 4; also attached.

The third variant does away with the list of steps, and uses a
paragraph to describe the letters. And the fourth variant makes that
paragraph terse.

In the order of preference I'd choose variant 1, then 2. Variants 3
and 4 feel like a significant degradation from variant 2.

Attached samples.txt shows the snippets of --help output of each of
the variants/patches, for comparison.

In [6] below, Tristan showed preference for the second variant.

[1] My complaint about -I initi_steps being severely under-documented
in --help output
https://www.postgresql.org/message-id/CABwTF4XMdHTxemhskad41Vj_hp2nPgifjwegOqR52_8-wEbv2Q%40mail.gmail.com

[2] Tristan Partin agreeing with the complaint, and suggesting a patch
would be welcome
https://www.postgresql.org/message-id/CT8BC7RXT33R.3CHYIXGD5NVHK%40gonk

[3] Greg Smith agreeing and saying he'd welcome a few more words about
the init_steps in --help output
https://www.postgresql.org/message-id/CAHLJuCUp5_VUo%2BRJ%2BpSnxeiiZfcstRtTubRP8%2Bu8NEqmrbp4aw%40mail.gmail.com

[4] First set of patches
https://www.postgresql.org/message-id/CABwTF4UKv43ZftJadsxs8%3Da07BmA1U4RU3W1qbmDAguVKJAmZw%40mail.gmail.com

[5] Second set of patches
https://www.postgresql.org/message-id/CABwTF4Ww42arY1Q88_iaraVLxqSU%2B8Yb4oKiTT5gD1sineog9w%40mail.gmail.com

[6] Tristan showing preference for the second variant
https://www.postgresql.org/message-id/CTBN5E2K2YSJ.3QYXGZ09JZXIW%40gonk

+CC Tristan Partin and Greg Smith, since they were involved in the
initial thread.

Best regards,
Gurjeet
http://Gurje.et
==== variant-1-brief-pointer-to-docs.patch
  -i, --initialize         invokes initialization mode
  -I, --init-steps=[dtgGvpf]+ (default "dtgvp")
                           run selected initialization steps, in the specified 
order
                           see pgbench documentation for a description of these 
steps
  -F, --fillfactor=NUM     set fill factor

==== variant-2-detailed-description.patch
  -i, --initialize         invokes initialization mode
  -I, --init-steps=[dtgGvpf]+ (default "dtgvp")
                           run selected initialization steps, in the specified 
order
                           d: Drop any existing pgbench tables
                           t: Create the tables used by the standard pgbench 
scenario
                           g: Generate data, client-side
                           G: Generate data, server-side
                           v: Invoke VACUUM on the standard tables
                           p: Create primary key indexes on the standard tables
                           f: Create foreign key constraints between the 
standard tables
  -F, --fillfactor=NUM     set fill factor

==== variant-3-details-not-list.patch
  -i, --initialize         invokes initialization mode
  -I, --init-steps=[dtgGvpf]+ (default "dtgvp")
                           run selected initialization steps, in the specified 
order.
                           These steps operate on standard tables used by 
pgbench
                           'd' drops the tables, 't' creates the tables, 'g' 
generates
                           the data on client-side, 'G' generates data on 
server-side,
                           'v' vaccums the tables, 'p' creates primary key 
constraints,
                           and 'f' creates foreign key constraints
  -F, --fillfactor=NUM     set fill factor

==== variant-4-terse-details-not-list.patch
  -i, --initialize         invokes initialization mode
  -I, --init-steps=[dtgGvpf]+ (default "dtgvp")
                           run selected initialization steps, in the specified 
order.
                           These steps operate on standard tables used by 
pgbench
                           'd' drop table, 't' create tables, 'g' generate data
                           client-side, 'G' generate data server-side, 'v' 
vaccum
                           tables, 'p' create primary keys, 'f' create foreign 
keys
  -F, --fillfactor=NUM     set fill factor

Attachment: variant-2-detailed-description.patch
Description: Binary data

Attachment: variant-1-brief-pointer-to-docs.patch
Description: Binary data

Attachment: variant-4-terse-details-not-list.patch
Description: Binary data

Attachment: variant-3-details-not-list.patch
Description: Binary data

Reply via email to