X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id E6F1ED1B8AC for ; Fri, 29 Aug 2003 14:26:58 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 25570-09 for ; Fri, 29 Aug 2003 11:26:30 -0300 (ADT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by svr1.postgresql.org (Postfix) with ESMTP id 51D0CD1B8B1 for ; Fri, 29 Aug 2003 11:26:26 -0300 (ADT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19skCt-0003Vl-00 for ; Fri, 29 Aug 2003 10:26:31 -0400 Received: by dba2 (Postfix, from userid 1019) id BD2FACF47; Fri, 29 Aug 2003 10:26:30 -0400 (EDT) Date: Fri, 29 Aug 2003 10:26:30 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: Force table to be permanently in cache? Message-ID: <20030829142630.GE19388@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <3F4CBD8A.4050309@potentialtech.com> <1061948112.15800.53.camel@gibraltar.mattclark.net> <3F4C1364.6080602@potentialtech.com> <1061990263.15800.124.camel@gibraltar.mattclark.net> <3F4CBD8A.4050309@potentialtech.com> <5.1.0.14.0.20030829144416.03be0248@195.145.148.245> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.0.20030829144416.03be0248@195.145.148.245> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/493 X-Sequence-Number: 3309 On Fri, Aug 29, 2003 at 02:52:10PM +0200, Fabian Kreitner wrote: > Hi everyone, > > I have a sql request which on first invocation completes in ~12sec but then > drops to ~3sec on the following runs. The 3 seconds would be acceptable but > how can I make sure that the data is cached and all times? Is it simply > enough to set shared_buffers high enough to hold the entire database (and > have enough ram installed of course)? The OS is linux in this case. If the table gets hit often enough, then it'll be in your filesystem cache anyway. See the many discussions of sizing shared_buffers in the archives of this list for thoughts on how big that should be. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110