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 8560D329E32 for ; Mon, 4 Oct 2004 20:18:58 +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 27014-07 for ; Mon, 4 Oct 2004 19:18:52 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [66.143.173.58]) by svr1.postgresql.org (Postfix) with ESMTP id 69A8C329D9F for ; Mon, 4 Oct 2004 20:18:52 +0100 (BST) Received: by flake.decibel.org (Postfix, from userid 1001) id 2D86C1C8F8; Mon, 4 Oct 2004 19:18:50 +0000 (GMT) Date: Mon, 4 Oct 2004 14:18:50 -0500 From: "Jim C. Nasby" To: Josh Berkus Cc: Postgresql Performance Subject: Re: Caching of Queries Message-ID: <20041004191850.GS1297@decibel.org> References: <00e801c4a4b6$5526dd30$8300a8c0@solent> <20040930221107.GP1297@decibel.org> <415CEE8E.8060805@ymogen.net> <200410011010.40705.josh@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200410011010.40705.josh@agliodbs.com> X-Operating-System: FreeBSD 4.10-RELEASE-p2 i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.6i 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: 200410/34 X-Sequence-Number: 8510 On Fri, Oct 01, 2004 at 10:10:40AM -0700, Josh Berkus wrote: > Transparent "query caching" is the "industry standard" for how these things > are handled. However, Postgres' lack of this feature has made me consider > other approaches, and I'm starting to wonder if the "standard" query caching > -- where a materialized query result, or some reduction thereof, is cached in > database memory -- isn't the best way to cache things. I'm going to > abbreviate it "SQC" for the rest of this e-mail. Not to quibble, but are you sure that's the standard? Oracle and DB2 don't do this, and I didn't think MSSQL did either. What they do do is cache query *plans*. This is a *huge* deal in Oracle; search http://asktom.oracle.com for 'soft parse'. In any case, I think a means of marking some specific queries as being cachable is an excellent idea; perfect for 'static data' scenarios. What I don't know is how much will be saved. -- Jim C. Nasby, Database Consultant decibel@decibel.org Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"