X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F379BDA0E1 for ; Tue, 4 Oct 2005 21:44:41 -0300 (ADT) 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 42785-02 for ; Wed, 5 Oct 2005 00:44:34 +0000 (GMT) Received: from outbound0.sv.meer.net (outbound0.sv.meer.net [205.217.152.13]) by svr1.postgresql.org (Postfix) with ESMTP id 754F0DA0F0 for ; Tue, 4 Oct 2005 21:44:35 -0300 (ADT) Received: from mail.meer.net (mail.meer.net [209.157.152.14]) by outbound0.sv.meer.net (8.12.10/8.12.6) with ESMTP id j950ffsm015975 for ; Tue, 4 Oct 2005 17:41:48 -0700 (PDT) (envelope-from trainor@transborder.net) Received: from [192.168.1.46] (pool-151-197-28-186.phil.east.verizon.net [151.197.28.186]) by mail.meer.net (8.13.3/8.13.3/meer) with ESMTP id j950erDY086499 for ; Tue, 4 Oct 2005 17:40:54 -0700 (PDT) (envelope-from trainor@transborder.net) Mime-Version: 1.0 (Apple Message framework v623) In-Reply-To: <32713495.1128468827337.JavaMail.root@elwamui-polski.atl.sa.earthlink.net> References: <32713495.1128468827337.JavaMail.root@elwamui-polski.atl.sa.earthlink.net> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <8bafaa62907deae2460ba2ecbb022741@transborder.net> Content-Transfer-Encoding: 7bit From: "Douglas J. Trainor" Subject: Re: Is There Any Way .... Date: Tue, 4 Oct 2005 20:40:54 -0400 To: pgsql-performance@postgresql.org X-Mailer: Apple Mail (2.623) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200510/62 X-Sequence-Number: 14830 Ron Peacetree sounds like someone talking out of his _AZZ_. He can save his unreferenced flapdoodle for his SQL Server clients. Maybe he will post references so that we may all learn at the feet of Master Peacetree. :-) douglas On Oct 4, 2005, at 7:33 PM, Ron Peacetree wrote: > pg is _very_ stupid about caching. Almost all of the caching is left > to the OS, and it's that way by design (as post after post by TL has > pointed out). > > That means pg has almost no ability to take application domain > specific knowledge into account when deciding what to cache. > There's plenty of papers on caching out there that show that > context dependent knowledge leads to more effective caching > algorithms than context independent ones are capable of. > > (Which means said design choice is a Mistake, but unfortunately > one with too much inertia behind it currentyl to change easily.) > > Under these circumstances, it is quite possible that an expert class > human could optimize memory usage better than the OS + pg. > > If one is _sure_ they know what they are doing, I'd suggest using > tmpfs or the equivalent for critical read-only tables. For "hot" > tables that are rarely written to and where data loss would not be > a disaster, "tmpfs" can be combined with an asyncronous writer > process push updates to HD. Just remember that a power hit > means that > > The (much) more expensive alternative is to buy SSD(s) and put > the critical tables on it at load time. > > Ron > > > -----Original Message----- > From: "Jim C. Nasby" > Sent: Oct 4, 2005 4:57 PM > To: Stefan Weiss > Cc: pgsql-performance@postgresql.org > Subject: Re: [PERFORM] Is There Any Way .... > > On Tue, Oct 04, 2005 at 12:31:42PM +0200, Stefan Weiss wrote: >> On 2005-09-30 01:21, Lane Van Ingen wrote: >>> (3) Assure that a disk-based table is always in memory (outside of >>> keeping >>> it in >>> memory buffers as a result of frequent activity which would >>> prevent >>> LRU >>> operations from taking it out) ? >> >> I was wondering about this too. IMO it would be useful to have a way >> to tell >> PG that some tables were needed frequently, and should be cached if >> possible. This would allow application developers to consider joins >> with >> these tables as "cheap", even when querying on columns that are not >> indexed. >> I'm thinking about smallish tables like users, groups, *types, etc >> which >> would be needed every 2-3 queries, but might be swept out of RAM by >> one >> large query in between. Keeping a table like "users" on a RAM fs >> would not >> be an option, because the information is not volatile. > > Why do you think you'll know better than the database how frequently > something is used? At best, your guess will be correct and PostgreSQL > (or the kernel) will keep the table in memory. Or, your guess is wrong > and you end up wasting memory that could have been used for something > else. > > It would probably be better if you describe why you want to force this > table (or tables) into memory, so we can point you at more appropriate > solutions.