X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C912CD1BAAE for ; Fri, 21 May 2004 16:02:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 93252-03 for ; Fri, 21 May 2004 16:02:34 -0300 (ADT) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by svr1.postgresql.org (Postfix) with ESMTP id 4A47DD1B1D5 for ; Fri, 21 May 2004 16:02:33 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by bob.samurai.com (Postfix) with ESMTP id 0DED61ED7; Fri, 21 May 2004 15:02:34 -0400 (EDT) Received: from bob.samurai.com ([127.0.0.1]) by localhost (bob.samurai.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 44284-01-7; Fri, 21 May 2004 15:02:33 -0400 (EDT) Received: from [24.156.130.254] (CPE000a95ab279e-CM014470008056.cpe.net.cable.rogers.com [24.156.130.254]) by bob.samurai.com (Postfix) with ESMTP id 026911EBD; Fri, 21 May 2004 15:02:33 -0400 (EDT) Message-ID: <40AE5248.8090807@samurai.com> Date: Fri, 21 May 2004 15:02:32 -0400 From: Neil Conway User-Agent: Mozilla Thunderbird 0.6 (Macintosh/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Rosser Schwarz Cc: 'Vitaly Belman' , 'Postgresql Performance' Subject: Re: PostgreSQL caching References: <002801c43f48$6d629930$2500fa0a@CardServices.TCI.com> In-Reply-To: <002801c43f48$6d629930$2500fa0a@CardServices.TCI.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailbox.samurai.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200405/186 X-Sequence-Number: 7017 Rosser Schwarz wrote: > PostgreSQL uses the operating system's disk cache. ... in addition to its own buffer cache, which is stored in shared memory. You're correct though, in that the best practice is to keep the PostgreSQL cache small and give more memory to the operating system's disk cache. > Pgsql uses the OS's disk cache instead of its own cache management > because the former is more likely to persist. If the postmaster > managed the cache, as soon as the last connection died, the memory > allocated for caching would be released, and all the cached data > would be lost. No; the cache is stored in shared memory. It wouldn't persist over postmaster restarts (without some scheme of saving and restoring it), but that has nothing to do with why the OS disk cache is usually kept larger than the PG shared buffer cache. -Neil