Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 01F86638330; Wed, 3 Feb 2010 09:43:41 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 09771-06; Wed, 3 Feb 2010 13:43:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by mail.postgresql.org (Postfix) with ESMTP id 8E0B8635930; Wed, 3 Feb 2010 09:43:00 -0400 (AST) Received: by fxm25 with SMTP id 25so721576fxm.34 for ; Wed, 03 Feb 2010 05:42:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=EVKNODo2SYKm0kVq1uMpzicNEluej84Kr3PTXAEgKn8=; b=tzzGLnxUda6ghCfXRyn3fBX71OlSbzhVcKNbb/g26NMAAEWXP/hSy9zTDMn295yaLr lVLWE56qpRHQH08fD7iD51wNXYamuIkLwbwmVCndyUE7Cn12uwbsdklwzbN/CVituWoy f+wznTNyrDVV+KdxNJdhjWlqHIgwwf/8bNhVM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Um3FyNuxw7PJb5wGCCSCyCwGy5DVRrAozNeUG4P2MvvbPQJT8tLTwO/5DsomaDDCdk PWQ8EAsjcLuxjLa84yPKh7O57xygumc7HBksDiq9aUt2UNlW9Vx7iT6kZx6vA3+jRShI o/V9Tcu5JVbsCwgNVF2uY9vljS6SHur8F7J/k= MIME-Version: 1.0 Received: by 10.239.173.67 with SMTP id d3mr942003hbf.110.1265204578119; Wed, 03 Feb 2010 05:42:58 -0800 (PST) In-Reply-To: <407d949e1002030353g522f1afev782a97fd755c5926@mail.gmail.com> References: <4427a97a0912101235x3ade510blcc00d5ce9883c6b6@mail.gmail.com> <23321.1265133015@sss.pgh.pa.us> <603c8f071002021014h4b489f44s9014377e1b38dbc7@mail.gmail.com> <201002021934.18444.andres@anarazel.de> <603c8f071002021106o5eef7b40r1ed21c9bd05251ec@mail.gmail.com> <29129.1265139210@sss.pgh.pa.us> <603c8f071002021145x1939c9e7hb2eedc8ae4dfe23e@mail.gmail.com> <407d949e1002030353g522f1afev782a97fd755c5926@mail.gmail.com> Date: Wed, 3 Feb 2010 08:42:57 -0500 Message-ID: <603c8f071002030542r779a4f47k78355c62b0b7853@mail.gmail.com> Subject: Re: [HACKERS] Re: Faster CREATE DATABASE by delaying fsync (was 8.4.1 ubuntu karmic slow createdb) From: Robert Haas To: Greg Stark Cc: Tom Lane , Andres Freund , pgsql-hackers@postgresql.org, pgsql-performance@postgresql.org, Michael Clemmons , Hannu Krosing , Scott Marlowe Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.473 tagged_above=-10 required=5 tests=AWL=0.126, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/54 X-Sequence-Number: 37475 On Wed, Feb 3, 2010 at 6:53 AM, Greg Stark wrote: > On Tue, Feb 2, 2010 at 7:45 PM, Robert Haas wrote: >> I think you're probably right, but it's not clear what the new name >> should be until we have a comment explaining what the function is >> responsible for. > > So I wrote some comments but wasn't going to repost the patch with the > unchanged name without explanation... But I think you're right though > I was looking at it the other way around. I want to have an API for a > two-stage sync and of course if I do that I'll comment it to explain > that clearly. > > The gist of the comments was that the function is preparing to fsync > to initiate the i/o early and allow the later fsync to fast -- but > also at the same time have the beneficial side-effect of avoiding > cache poisoning. It's not clear that the two are necessarily linked > though. Perhaps we need two separate apis, though it'll be hard to > keep them separate on all platforms. Well, maybe we should start with a discussion of what kernel calls you're aware of on different platforms and then we could try to put an API around it. I mean, right now all you've got is POSIX_FADV_DONTNEED, so given just that I feel like the API could simply be pg_dontneed() or something. It's hard to design a general framework based on one example. ...Robert