diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-04-14 17:51:25 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-04-14 17:51:25 -0400 |
commit | 85a0781334a204c15c9c6ea9d3e6c75334c2beb6 (patch) | |
tree | 165967f8a4ee544ef6e0fb371495287d1c2fbe8e /src/backend/bootstrap/bootstrap.c | |
parent | 2040bb4a0b50ef0434a1a723f00d040ab4f1c06f (diff) |
Use one transaction while reading postgres.bki, not one per line.
AFAICT, the only actual benefit of closing a bootstrap transaction
is to reclaim transient memory. We can do that a lot more cheaply
by just doing a MemoryContextReset on a suitable context. This
gets the runtime of the "bootstrap" phase of initdb down to the
point where, at least by eyeball, it's quite negligible compared
to the rest of the phases. Per discussion with Andres Freund.
Discussion: https://postgr.es/m/9244.1492106743@sss.pgh.pa.us
Diffstat (limited to 'src/backend/bootstrap/bootstrap.c')
-rw-r--r-- | src/backend/bootstrap/bootstrap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index 46c207c86c8..4c28b2b821a 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -18,6 +18,7 @@ #include <signal.h> #include "access/htup_details.h" +#include "access/xact.h" #include "bootstrap/bootstrap.h" #include "catalog/index.h" #include "catalog/pg_collation.h" @@ -496,7 +497,9 @@ BootstrapModeMain(void) /* * Process bootstrap input. */ + StartTransactionCommand(); boot_yyparse(); + CommitTransactionCommand(); /* * We should now know about all mapped relations, so it's okay to write |