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 DCE00329F43 for ; Mon, 27 Sep 2004 21:46:50 +0100 (BST) 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 35506-05 for ; Mon, 27 Sep 2004 20:46:43 +0000 (GMT) Received: from gp.word-to-the-wise.com (gp.word-to-the-wise.com [64.71.176.18]) by svr1.postgresql.org (Postfix) with ESMTP id 4C2E7329DBF for ; Mon, 27 Sep 2004 21:46:44 +0100 (BST) Received: by gp.word-to-the-wise.com (Postfix, from userid 500) id CBA9290005F; Mon, 27 Sep 2004 13:53:45 -0700 (PDT) Date: Mon, 27 Sep 2004 13:53:45 -0700 From: Steve Atkins To: pgsql-performance@postgresql.org Subject: Re: Caching of Queries Message-ID: <20040927205345.GA29554@gp.word-to-the-wise.com> References: <00e801c4a4b6$5526dd30$8300a8c0@solent> <330532b604092711591491303a@mail.gmail.com> <415875C0.3010805@ymogen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <415875C0.3010805@ymogen.net> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/298 X-Sequence-Number: 8426 On Mon, Sep 27, 2004 at 09:19:12PM +0100, Matt Clark wrote: > >Basically you set a default in seconds for the HTML results to be > >cached, and then have triggers set that force the cache to regenerate > >(whenever CRUD happens to the content, for example). > > > >Can't speak for Perl/Python/Ruby/.Net/Java, but Cache_Lite sure made a > >believer out of me! > > > > > > > Nice to have it in a library, but if you want to be that simplistic then > it's easy in any language. What if a process on server B modifies a n > important value that server A has cached though? Coherency (albeit that > the client may choose to not use it) is a must for a general solution. memcached is one solution designed for that situation. Easy to use from most languages. Works. Lets you use memory on systems where you have it, rather than using up valuable database server RAM that's better spent caching disk sectors. Any competently written application where caching results would be a suitable performance boost can already implement application or middleware caching fairly easily, and increase performance much more than putting result caching into the database would. I don't see caching results in the database as much of a win for most well written applications. Toy benchmarks, sure, but for real apps it seems it would add a lot of complexity, and violate the whole point of using an ACID database. (Caching parse trees or query plans, though? It'd be interesting to model what effect that'd have.) Cheers, Steve