Initialize backend status reporting during bootstrap.
authorAndres Freund <[email protected]>
Fri, 19 Nov 2021 16:43:12 +0000 (08:43 -0800)
committerAndres Freund <[email protected]>
Fri, 19 Nov 2021 16:43:12 +0000 (08:43 -0800)
This allows a later commit to reduce the number of branches in performance
sensitive functions during normal running, compared to a very minor saving
during bootstrapping.

Author: Melanie Plageman <[email protected]>
Reviewed-By: Andres Freund <[email protected]>
Discussion: https://postgr.es/m/CAAKRu_Yeg+vh6SHNEo1+=O7e-BPX35cU0XQM=YwQRnkFyv_y+w@mail.gmail.com

src/backend/utils/init/postinit.c

index 0c56c38a141de9a6d780d26ca4b47efe9d114956..646126edee57d240451502711d60c07a4528133c 100644 (file)
@@ -676,8 +676,7 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
        EnablePortalManager();
 
        /* Initialize status reporting */
-       if (!bootstrap)
-               pgstat_beinit();
+       pgstat_beinit();
 
        /*
         * Load relcache entries for the shared system catalogs.  This must create