postgresql/src/backend/utils
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
..
adt Add missing CHECK_FOR_INTERRUPTS in lseg_inside_poly 2015-12-14 16:44:40 -03:00
cache Avoid caching expression state trees for domain constraints across queries. 2015-11-29 18:18:42 -05:00
error Coordinate log_line_prefix options 'm' and 'n' to share a timeval. 2015-09-07 15:40:49 -07:00
fmgr pgindent run for 9.5 2015-05-23 21:35:49 -04:00
hash Remove volatile qualifiers from dynahash.c, shmem.c, and sinvaladt.c 2015-10-16 14:14:15 -04:00
init Perform an immediate shutdown if the postmaster.pid file is removed. 2015-10-06 17:15:52 -04:00
mb Use just one standalone-backend session for initdb's post-bootstrap steps. 2015-12-17 19:38:21 -05:00
misc Message improvements 2015-11-16 21:39:23 -05:00
mmgr Improve performance in freeing memory contexts 2015-12-08 17:32:49 -06:00
resowner Update copyright for 2015 2015-01-06 11:43:47 -05:00
sort Improve comments about abbreviation abort. 2015-11-03 14:11:49 -05:00
time Fix failure to consider failure cases in GetComboCommandId(). 2015-11-26 13:23:02 -05:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
Gen_dummy_probes.sed Update copyright for 2015 2015-01-06 11:43:47 -05:00
Gen_fmgrtab.pl Allow forcing nullness of columns during bootstrap. 2015-02-21 22:31:54 +01:00
generate-errcodes.pl Update copyright for 2015 2015-01-06 11:43:47 -05:00
Makefile Make handling of errcodes.h more consistent with other generated headers. 2011-02-04 09:29:10 -05:00
probes.d Update copyright for 2015 2015-01-06 11:43:47 -05:00