Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 0D8EE6324D2; Tue, 29 Dec 2009 07:13:43 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 92341-08; Tue, 29 Dec 2009 11:13:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.anarazel.de (mail.anarazel.de [217.115.131.40]) by mail.postgresql.org (Postfix) with ESMTP id 24B7D63222E; Tue, 29 Dec 2009 07:13:31 -0400 (AST) Received: from alap2.localnet (e178200165.adsl.alicedsl.de [85.178.200.165]) by mail.anarazel.de (Postfix) with ESMTPSA id 2C457448003; Tue, 29 Dec 2009 12:13:27 +0100 (CET) From: Andres Freund To: Greg Stark Subject: Re: [HACKERS] Faster CREATE DATABASE by delaying fsync (was 8.4.1 ubuntu karmic slow createdb) Date: Tue, 29 Dec 2009 12:13:21 +0100 User-Agent: KMail/1.13.0 (Linux/2.6.33-rc2-andres-00001-g6e0f169; KDE/4.3.85; x86_64; ; ) Cc: pgsql-hackers@postgresql.org, Greg Smith , Tom Lane , pgsql-performance@postgresql.org, Michael Clemmons , Hannu Krosing , Scott Marlowe References: <4427a97a0912101235x3ade510blcc00d5ce9883c6b6@mail.gmail.com> <200912290305.39932.andres@anarazel.de> <407d949e0912290248y24acd059q1f31d6f0d057bbe6@mail.gmail.com> In-Reply-To: <407d949e0912290248y24acd059q1f31d6f0d057bbe6@mail.gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912291213.21721.andres@anarazel.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.439 tagged_above=-10 required=5 tests=AWL=0.160, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/263 X-Sequence-Number: 36877 On Tuesday 29 December 2009 11:48:10 Greg Stark wrote: > On Tue, Dec 29, 2009 at 2:05 AM, Andres Freund wrote: > > Reads Completed: 2, 8KiB Writes Completed: 2362, > > 29672KiB New: > > Reads Completed: 0, 0KiB Writes Completed: 550, > > 5960KiB > > It looks like the new method is only doing 1/6th as much i/o. Do you > know what's going on there? While I was surprised by the amount of difference I am not surprised at all that there is a significant one - currently the fsync will write out a whole bunch of useless stuff every time its called (all metadata, directory structure and so on) This is reproducible... 6MB sounds sensible for the operation btw - the template database is around 5MB. Will try to analyze later what exactly causes the additional io. Andres