Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czF1L-0003MV-9V for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Apr 2017 04:09:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1czF1K-00044T-T8 for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Apr 2017 04:09:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1czEzs-0001Sj-3F for pgsql-hackers@postgresql.org; Sat, 15 Apr 2017 04:07:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1czEzp-00089h-8E for pgsql-hackers@postgresql.org; Sat, 15 Apr 2017 04:07:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v3F47XmH005808; Sat, 15 Apr 2017 00:07:34 -0400 From: Tom Lane To: Andreas Karlsson cc: Andres Freund , pgsql-hackers@postgresql.org Subject: Re: Cutting initdb's runtime (Perl question embedded) In-reply-to: References: <30896.1492006367@sss.pgh.pa.us> <972d541d-7285-53ff-ea71-dcbfd886570a@proxel.se> <6312.1492100010@sss.pgh.pa.us> <20170413164132.3nhobp4z4wnnvhca@alap3.anarazel.de> <27409.1492102574@sss.pgh.pa.us> <20170413170614.6pv2mpqiq7s6huio@alap3.anarazel.de> <9244.1492106743@sss.pgh.pa.us> <20170413204223.7znfwllhqmglzaam@alap3.anarazel.de> <12002.1492206859@sss.pgh.pa.us> Comments: In-reply-to Andreas Karlsson message dated "Sat, 15 Apr 2017 03:44:18 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5806.1492229253.1@sss.pgh.pa.us> Date: Sat, 15 Apr 2017 00:07:33 -0400 Message-ID: <5807.1492229253@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andreas Karlsson writes: > Looked some at this and what take time now for me seems to mainly be > these four things (out of a total runtime of 560 ms). > 1. setup_conversion: 140 ms > 2. select_default_timezone: 90 ms > 3. bootstrap_template1: 80 ms > 4. setup_schema: 65 ms FWIW, you can bypass select_default_timezone by setting environment variable TZ to a valid timezone name before calling initdb. On my workstation, that currently cuts the time for "initdb --no-sync" from about 1.25 sec to just about exactly 1.0 sec. I doubt that we want all the buildfarm members to switch over to doing that, since then we'd lose coverage of select_default_timezone. But it's interesting to speculate about having the buildfarm script extract the selected timezone name out of postgresql.conf after the first initdb it does, and then set TZ for remaining tests. We surely don't need to test select_default_timezone more than once per buildfarm run. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers