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 08B0ED1DA2E for ; Fri, 27 Feb 2004 00:49:39 +0000 (GMT) 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 62840-04 for ; Thu, 26 Feb 2004 20:49:35 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 4B080D1E132 for ; Thu, 26 Feb 2004 20:49:32 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i1R0nV1Y065804 for ; Fri, 27 Feb 2004 00:49:31 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i1R0lbxJ065674 for pgsql-performance@postgresql.org; Fri, 27 Feb 2004 00:47:37 GMT From: William Yu X-Newsgroups: comp.databases.postgresql.performance Subject: Re: A cache for the results of queries ? Date: Thu, 26 Feb 2004 16:40:25 -0800 Organization: Hub.Org Networking Services Lines: 10 Message-ID: References: <20040226133038.GA1481@apartia.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en In-Reply-To: <20040226133038.GA1481@apartia.fr> To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/311 X-Sequence-Number: 5835 David Pradier wrote: > i'd like to know if it exists a system of cache for the results of > queries. If you are willing to do this at an application level, you could calculate a MD5 for every query you plan to run and then SELECT INTO a temporary table that's based on the MD5 sum (e.g. TMP_CACHE_45123). Next time somebody runs a query, check to see if that table exists already. Then you just have to figure out some way to know when results should be expired.