Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id A090065B297 for ; Tue, 16 Mar 2010 18:34:10 -0300 (ADT) 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 25426-01-8 for ; Tue, 16 Mar 2010 21:33:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id E55D4797883 for ; Tue, 16 Mar 2010 18:30:59 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 8245634803D; Tue, 16 Mar 2010 14:30:57 -0700 (PDT) Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S2nHhE5niaFM; Tue, 16 Mar 2010 14:30:57 -0700 (PDT) Received: from perhan.alvh.no-ip.org (200-85-214-83.bk4-dsl.surnet.cl [200.85.214.83]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 0E69434803A; Tue, 16 Mar 2010 14:30:57 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 56F7F6E4BD; Tue, 16 Mar 2010 18:30:54 -0300 (CLST) Date: Tue, 16 Mar 2010 18:30:54 -0300 From: Alvaro Herrera To: Greg Stark Cc: Tom Lane , Pierre C , Greg Smith , Dave Crooke , Paul McGarry , pgsql-performance@postgresql.org Subject: Re: shared_buffers advice Message-ID: <20100316213054.GG3037@alvh.no-ip.org> References: <4B9F3302.4020900@2ndquadrant.com> <8285.1268749832@sss.pgh.pa.us> <407d949e1003160753o6e5faa48rabaa42f7548029b7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <407d949e1003160753o6e5faa48rabaa42f7548029b7@mail.gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.558 tagged_above=-10 required=5 tests=AWL=0.041, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/177 X-Sequence-Number: 38002 Greg Stark escribió: > On Tue, Mar 16, 2010 at 2:30 PM, Tom Lane wrote: > > "Pierre C" writes: > >> Does PG issue checkpoint writes in "sorted" order ? > > > > No.  IIRC, a patch for that was submitted, and rejected because no > > significant performance improvement could be demonstrated.  We don't > > have enough information about the actual on-disk layout to be very > > intelligent about this, so it's better to just issue the writes and > > let the OS sort them. > > Keep in mind that postgres is issuing writes to the OS buffer cache. > It defers fsyncing the files as late as it can in the hopes that most > of those buffers will be written out by the OS before then. That gives > the OS a long time window in which to flush them out in whatever order > and whatever schedule is most convenient. Maybe it would make more sense to try to reorder the fsync calls instead. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.