X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CBB69D1B451 for ; Thu, 3 Jun 2004 18:29:43 -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 88336-05 for ; Thu, 3 Jun 2004 21:29:45 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 61FE6D1B435 for ; Thu, 3 Jun 2004 18:29:41 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1BVzmN-00009U-00; Fri, 04 Jun 2004 09:29:39 +1200 Message-ID: <40BF985F.1000802@opencloud.com> Date: Fri, 04 Jun 2004 09:30:07 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pg@fastcrypt.com Cc: "pgsql-jdbc@postgresql.org" Subject: Re: cacheing metadata References: <1076992127.6799.153.camel@localhost.localdomain> In-Reply-To: <1076992127.6799.153.camel@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200406/11 X-Sequence-Number: 10213 Dave Cramer wrote: > There is some interest in caching meta-data. I am wondering what the > community thinks of the idea. Are there really metadata-query-heavy apps out there that would benefit? Do you have an example of one? I'd have thought that most if not all of the metadata-related tables would all be sitting in cache anyway. It seems like this is a special case of the more general "I run expensive queries and don't want to rerun them to pick up changes". And a very special case at that -- metadata doesn't usually change very often. If the app is essentially a UI frontend I'd say you could get away with caching results in the app (not the driver) and having a "reload" button. If the app really needs up-to-the-moment metadata state to control whatever actions that follow, it'll need to hit the DB with the full metadata query while in a transaction to get the right isolation characteristics, won't it? > Notionally it would be used to speed up DataBaseMetaData queries. It > will require some work on the backend to create triggers on schema > changes. This is being considered as we speak. If you're going to be adding support triggers to every DB anyway, why not bite the bullet and do a stored proc that maintains a cache table of materialized metadata, or something similar? -O