Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 943A3633596; Mon, 28 Dec 2009 19:06:45 -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 78606-07; Mon, 28 Dec 2009 23:06:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id C3EA6633592; Mon, 28 Dec 2009 19:06:34 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id nBSN6SvT003455; Mon, 28 Dec 2009 18:06:28 -0500 (EST) To: Andres Freund cc: pgsql-performance@postgresql.org, pgsql-hackers@postgresql.org, Michael Clemmons , Hannu Krosing , Scott Marlowe Subject: Re: [HACKERS] Faster CREATE DATABASE by delaying fsync (was 8.4.1 ubuntu karmic slow createdb) In-reply-to: <200912282354.51892.andres@anarazel.de> References: <4427a97a0912101235x3ade510blcc00d5ce9883c6b6@mail.gmail.com> <4427a97a0912121236g4c06c562u221d638810ed2b6e@mail.gmail.com> <200912122138.42404.andres@anarazel.de> <200912282354.51892.andres@anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 28 Dec 2009 23:54:51 +0100" Date: Mon, 28 Dec 2009 18:06:28 -0500 Message-ID: <3454.1262041588@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.546 tagged_above=-10 required=5 tests=AWL=0.053, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/247 X-Sequence-Number: 36861 Andres Freund writes: > This speeds up CREATE DATABASE from ~9 seconds to something around 0.8s on my > laptop. Still slower than with fsync off (~0.25) but quite a worthy > improvement. I can't help wondering whether that's real or some kind of platform-specific artifact. I get numbers more like 3.5s (fsync off) vs 4.5s (fsync on) on a machine where I believe the disks aren't lying about write-complete. It makes sense that an fsync at the end would be a little bit faster, because it would give the kernel some additional freedom in scheduling the required I/O, but it isn't cutting the total I/O required at all. So I find it really hard to believe a 10x speedup. regards, tom lane