pgbench --startup option - Mailing list pgsql-hackers

From Jeff Janes
Subject pgbench --startup option
Date
Msg-id CAMkU=1xV3tYKoHD8U2mQzfC5Kbn_bdcVf8br-EnUvy-6Z=B47w@mail.gmail.com
Whole thread Raw
Responses Re: pgbench --startup option  (Peter Geoghegan <peter.geoghegan86@gmail.com>)
Re: pgbench --startup option  (Jeff Janes <jeff.janes@gmail.com>)
Re: pgbench --startup option  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
While looking at some proposed patches and pondering some questions on performance, I realized I desperately needed ways to run benchmarks with different settings without needing to edit postgresql.conf and restart/reload the server each time.

Most commonly, I want to run with synchronous_commit on or off at whim.  I thought of writing a patch specifically for that, but decided a more general approach would be better.  The attached patch allows any arbitrary command to be executed upon the start up of each connection intended for benchmarking (as opposed to utility connections, intended for either -i or for counting the rows in in pgbench_branches and for vacuuming), and so covers the need for changing any session-changeable GUCs, plus doing other things as well.

I created doBenchMarkConnect() to segregate bench-marking connections from utility connections.  At first I thought of adding the startup code to only the normal path and leaving support for -C in the wind, but decided that was just lazy.

Will add to commitfest-next.

Cheers,

Jeff
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: backup.sgml patch that adds information on custom format backups
Next
From: Peter Geoghegan
Date:
Subject: Re: pgbench --startup option