X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CDB208B9D70 for ; Tue, 15 Feb 2005 18:40:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 96813-05 for ; Tue, 15 Feb 2005 18:39:57 +0000 (GMT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by svr1.postgresql.org (Postfix) with ESMTP id 9AB848B9D1F for ; Tue, 15 Feb 2005 18:39:56 +0000 (GMT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1D17bu-0003SV-00; Tue, 15 Feb 2005 13:39:46 -0500 To: Josh Berkus Cc: Greg Stark , Tom Lane , Mark Aufflick , pgsql-performance@postgresql.org Subject: Re: seq scan cache vs. index cache smackdown References: <9326.1108452962@sss.pgh.pa.us> <87vf8u2qgw.fsf@stark.xeocode.com> <200502150922.59176.josh@agliodbs.com> In-Reply-To: <200502150922.59176.josh@agliodbs.com> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 15 Feb 2005 13:39:46 -0500 Message-ID: <87k6p93bwt.fsf@stark.xeocode.com> Lines: 24 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.056 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/242 X-Sequence-Number: 10571 Josh Berkus writes: > Why is mmap not workable? It would require far-reaching changes to our code > -- certainly -- but I don't think it can be eliminated from consideration. Fundamentally because there is no facility for being notified by the OS before a page is written to disk. And there's no way to prevent a page from being written to disk (mlock just prevents it from being flushed from memory, not from being synced to disk). So there's no way to guarantee the WAL will be written before the buffer is synced to disk. Maybe it could be done by writing and syncing the WAL independently before the shared buffer is written to at all, but that would be a completely different model. And it would locking the shared buffer until the sync is done, and require a private copy of the shared buffer necessitating more copies than the double buffering in the first place. -- greg