mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-31 10:07:23 +02:00
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. |
||
---|---|---|
.. | ||
initdb | ||
pg_archivecleanup | ||
pg_basebackup | ||
pg_config | ||
pg_controldata | ||
pg_ctl | ||
pg_dump | ||
pg_resetxlog | ||
pg_rewind | ||
pg_test_fsync | ||
pg_test_timing | ||
pg_upgrade | ||
pg_xlogdump | ||
pgbench | ||
pgevent | ||
psql | ||
scripts | ||
Makefile |