Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czNmC-0003AG-BQ for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Apr 2017 13:30:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1czNmB-0008B6-E8 for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Apr 2017 13:30:07 +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 1czNm9-00088k-4b for pgsql-hackers@postgresql.org; Sat, 15 Apr 2017 13:30:05 +0000 Received: from mail-yw0-x233.google.com ([2607:f8b0:4002:c05::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1czNm0-0001lm-SU for pgsql-hackers@postgresql.org; Sat, 15 Apr 2017 13:30:04 +0000 Received: by mail-yw0-x233.google.com with SMTP id l189so43096758ywb.0 for ; Sat, 15 Apr 2017 06:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=ImF6PK5cO0MT5B49OLa456j6usLXQiQipdH331IYA+0=; b=I3dTwvrvALCG+UO6paZVbOucw/kdFQR/mMktDPA594EWmHWBZ/FnCXCMwAYBIvo+kR NHN8rcklj00Sm7sXrWkzlbb2YS2ptF/2Ouv+IV7IXw8maJwf1gXn6lOCHwX8FJHhM8hy 3T8GbWdt9QJGEC0i3d58Ndaros8fFfCnytu1BPe2htR8YdLhhLEU8b/d90nU7LfAVcrs xzQUSfnjVEtpMi7M9eGGBnFIbiuSSIoKIX2yWNUf3Y/RgqmtAEeTW4Z/0XvGfpdMF/ig C/kaIGrxv45h71nO9eqGLjwtd/okdRKxKAuVPsa2dJC8WafJJNEaVXihwfbctM2N/56I FaCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ImF6PK5cO0MT5B49OLa456j6usLXQiQipdH331IYA+0=; b=gyjwEf8Sh83xwquir8Ds8FvqO7n6dCJE+85UJ0gRnnXCpml+hOUUln6GcUf4pHQUey A1oYEU68qJEKWuc9VtAidLH0HELB9+T0gAJpNm/M9Wy8jDeaBfcZmB2uk3h5/xdv+pJM 0ggkcTrhWG3TR427tYsrBAly9616YPAn2MPn6QW/USsUGRTirAs45u0TrD/Fp2DLls3H iGcwKAt0XBRSFh3m77x8HgHLckz1S5h+FP1JVZJOzYXMzda2woRK/TmLCZNJ5W52VCZh bYnVQkX0dmskzM+g3rkYTqTPr+88H2OAvPuyaSXv0Z9NiC6oQtnsBmbH6kRuPA7RNaMd pwNw== X-Gm-Message-State: AN3rC/7qvb1Scfk4Gwcxrv++V+Sp7lsLnxOCAtPaoZoqa1puldlh2AVJ 0VcdvO+mKF5F21XOccyAE9YVcdtgwuV/LzinDTx2I3CgfrJH0ZBh+RDtDA1dMuk/6qw9Jtd1ZDo Oa/vDKZoKub4imVVfgHsKHCAXtpsz3TejFmbeJbKKTkcPM9F5ZpK2jOg3ltG//xtU1psgoDRCWg RHgAI4 X-Received: by 10.129.4.134 with SMTP id 128mr10709708ywe.109.1492262994519; Sat, 15 Apr 2017 06:29:54 -0700 (PDT) Received: from [192.168.10.146] ([98.122.164.227]) by smtp.gmail.com with ESMTPSA id b21sm1935345ywa.48.2017.04.15.06.29.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Apr 2017 06:29:53 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: Cutting initdb's runtime (Perl question embedded) To: Tom Lane , Andreas Karlsson 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> <5807.1492229253@sss.pgh.pa.us> Cc: Andres Freund , pgsql-hackers@postgresql.org Message-ID: Date: Sat, 15 Apr 2017 09:29:53 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <5807.1492229253@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 On 04/15/2017 12:07 AM, Tom Lane wrote: > 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. > > Yeah. The obvious place to do this would be the "make check" stage, which runs very early. Unfortunately, pg_regress carefully removes its data directory on success - kind of a pity that's not switchable. Probably for now the simplest thing for buildfarm animals whose owners are trying to squeeze every last second would be to put something like TZ => 'Us/Eastern', in the build_env section of the config file. But as you say we don't want everyone doing that. Alternatively, we could have an initdb TAP test that explicitly removed the environment setting so we'd get coverage of select_default_timezone, and have the buildfarm set TZ to something if it's not already set. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers