postgresql/src/backend
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
..
access Provide a way to predefine LWLock tranche IDs. 2015-12-15 11:48:19 -05:00
bootstrap pgindent run for 9.5 2015-05-23 21:35:49 -04:00
catalog Adjust behavior of single-user -j mode for better initdb error reporting. 2015-12-17 19:34:15 -05:00
commands Rework internals of changing a type's ownership 2015-12-17 14:25:41 -03:00
executor Improve some messages 2015-12-10 22:05:27 -05:00
foreign
lib Avoid use of float arithmetic in bipartite_match.c. 2015-08-23 13:02:18 -04:00
libpq Message improvements 2015-11-16 21:39:23 -05:00
main Revoke support for strxfrm() that write past the specified array length. 2015-07-08 20:44:21 -04:00
nodes Get rid of the planner's LateralJoinInfo data structure. 2015-12-11 15:52:38 -05:00
optimizer Collect the global OR of hasRowSecurity flags for plancache 2015-12-14 20:05:43 -05:00
parser Mark CHECK constraints declared NOT VALID valid if created with table. 2015-12-16 07:43:56 -05:00
po Translation updates 2015-06-28 23:56:55 -04:00
port On Windows, ensure shared memory handle gets closed if not being used. 2015-10-13 11:21:33 -04:00
postmaster Message improvements 2015-11-16 21:39:23 -05:00
regex Fix enforcement of restrictions inside regexp lookaround constraints. 2015-11-07 12:43:24 -05:00
replication Consistently set all fields in pg_stat_replication to null instead of 0 2015-12-13 16:53:38 +01:00
rewrite Get rid of the planner's LateralJoinInfo data structure. 2015-12-11 15:52:38 -05:00
snowball Adjust behavior of single-user -j mode for better initdb error reporting. 2015-12-17 19:34:15 -05:00
storage Teach mdnblocks() not to create zero-length files. 2015-12-15 13:57:45 -05:00
tcop Adjust behavior of single-user -j mode for better initdb error reporting. 2015-12-17 19:34:15 -05:00
tsearch pgindent run for 9.5 2015-05-23 21:35:49 -04:00
utils Use just one standalone-backend session for initdb's post-bootstrap steps. 2015-12-17 19:38:21 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk
Makefile Revert "Have dtrace depend on object files directly, not objfiles.txt" 2015-10-15 13:16:03 -04:00
nls.mk Remove trailing slashes from directories in find command 2015-09-18 22:06:54 -04:00