initdb currently does
PG_CMD_PUTS("ANALYZE;\nVACUUM FULL;\nVACUUM FREEZE;\n");
FREEZE is now part of FULL, so this seems redundant. Also, ANALYZE can
be run as part of VACUUM. So this could be
PG_CMD_PUTS("VACUUM FULL ANALYZE;\n");
There has been some concerns about time spent in initdb in test suites,
which is why I looked into this. In testing, this change can shave off
between 10% and 20% of the run time of initdb, so it would be kind of
useful.
The last change to this was
commit 66cd8150636e48a8f143560136a25ec5eb355d8c
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Mon Nov 29 03:05:03 2004 +0000
Clean up initdb's error handling so that it prints something more useful than just \'failed\' when there's a
problem. Per gripe from Chris Albertson.
In an unrelated change, use VACUUM FULL; VACUUM FREEZE; rather than a single VACUUM FULL FREEZE command, to
respondto my worries of a couple days ago about the reliability of doing this in one go.
That was a long time ago. Is that still applicable?