postgresql/src/bin
Tom Lane c4a8812cf6 Use just one standalone-backend session for initdb's post-bootstrap steps.
Previously, each subroutine in initdb fired up its own standalone backend
session.  Over time we'd grown as many as fifteen of these sessions,
and the cumulative startup and shutdown work for them was getting pretty
noticeable.  Combining things so that all these steps share a single
backend session cuts a good 10% off the total runtime of initdb, more
if you're not fsync'ing.

The main stumbling block to doing this before was that some of the sessions
were run with -j and some not.  The improved definition of -j mode
implemented by my previous commit makes it possible to fix that by running
all the post-bootstrap steps with -j; we just have to use double instead of
single newlines to end command strings.  (This is only absolutely necessary
around the VACUUM and CREATE DATABASE steps, since those can't be run in a
transaction block.  But it seems best to make them all use double newlines
so that the commands remain separate for error-reporting purposes.)

A minor disadvantage is that since initdb can't tell how much of its
output the backend has executed, we can no longer have the per-step
progress reporting initdb used to print.  But things are fast enough
nowadays that that's not really all that useful anyway.

In passing, add more const decoration to some of the static arrays in
initdb.c.
2015-12-17 19:38:21 -05:00
..
initdb Use just one standalone-backend session for initdb's post-bootstrap steps. 2015-12-17 19:38:21 -05:00
pg_archivecleanup Make WAL-related utilities handle .partial WAL files properly. 2015-07-03 11:53:58 +09:00
pg_basebackup Cleanup some problems in new Perl test code 2015-12-07 19:39:57 -03:00
pg_config Translation updates 2015-06-28 23:56:55 -04:00
pg_controldata Cleanup some problems in new Perl test code 2015-12-07 19:39:57 -03:00
pg_ctl Refactor Perl test code 2015-12-02 18:46:16 -03:00
pg_dump Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:21:31 -05:00
pg_resetxlog Make pg_controldata report newest XID with valid commit timestamp 2015-09-24 23:31:17 +09:00
pg_rewind Add missing cleanup logic in pg_rewind/t/005_same_timeline.pl test. 2015-12-14 19:22:50 -05:00
pg_test_fsync Move pg_test_fsync from contrib/ to src/bin/ 2015-04-19 22:20:49 -04:00
pg_test_timing Move pg_test_timing from contrib/ to src/bin/ 2015-04-20 21:30:12 -04:00
pg_upgrade pg_upgrade: fix CopyFile() on Windows to fail on file existence 2015-11-24 17:18:28 -05:00
pg_xlogdump Improve includes introduced in the replication origins patch. 2015-08-06 12:41:46 +02:00
pgbench Fix incorrect tps number calculation in "excluding connections establishing". 2015-09-30 10:53:31 +09:00
pgevent Update copyright for 2015 2015-01-06 11:43:47 -05:00
psql Fix improper initialization order for readline. 2015-12-17 16:55:23 -05:00
scripts Fix behavior of printTable() and friends with externally-invoked pager. 2015-12-02 18:20:41 -05:00
Makefile Move pg_xlogdump from contrib/ to src/bin/ 2015-04-21 19:03:49 -04:00