Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6BB71633C8D; Mon, 28 Dec 2009 20:43:35 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 34761-08; Tue, 29 Dec 2009 00:43:24 +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 3A5DC633877; Mon, 28 Dec 2009 20:43:19 -0400 (AST) Received: from alap2.localnet (alap2.visitor.congress.ccc.de [81.163.101.249]) by mail.anarazel.de (Postfix) with ESMTPSA id 8517B448009; Tue, 29 Dec 2009 01:43:16 +0100 (CET) From: Andres Freund To: david@lang.hm Subject: Re: Re: Faster CREATE DATABASE by delaying fsync (was 8.4.1 ubuntu karmic =?iso-8859-1?q?=09slow?= createdb) Date: Tue, 29 Dec 2009 01:43:15 +0100 User-Agent: KMail/1.13.0 (Linux/2.6.33-rc2-andres-00001-g6e0f169; KDE/4.3.85; x86_64; ; ) Cc: Greg Stark , pgsql-performance@postgresql.org, pgsql-hackers@postgresql.org, Michael Clemmons , Hannu Krosing , Scott Marlowe References: <4427a97a0912101235x3ade510blcc00d5ce9883c6b6@mail.gmail.com> <407d949e0912281627q2b857c8cn672e3a9b2cb083a0@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912290143.15866.andres@anarazel.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/253 X-Sequence-Number: 36867 On Tuesday 29 December 2009 01:30:17 david@lang.hm wrote: > On Tue, 29 Dec 2009, Greg Stark wrote: > > On Mon, Dec 28, 2009 at 10:54 PM, Andres Freund wrote: > >> fsync everything in that pass. > >> Including the directory - which was not done before and actually might > >> be necessary in some cases. > > > > Er. Yes. At least on ext4 this is pretty important. I wish it weren't, > > but it doesn't look like we're going to convince the ext4 developers > > they're crazy any day soon and it would really suck for a database > > created from a template to have files in it go missin. > > actually, as I understand it you need to do this on all filesystems except > ext3, and on ext3 fsync is horribly slow because it writes out > _everything_ that's pending, not just stuff related to the file you do the > fsync on. I dont think its all filesystems (ext2 should not be affected...), but generally youre right. At least jfs, xfs are affected as well. Its btw not necessarily nearly-safe and slow on ext3 as well (data=writeback). Andres