X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8D7B652A0F for ; Sun, 17 Jul 2005 11:07:09 -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 93325-09 for ; Sun, 17 Jul 2005 14:07:02 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 91611529E1 for ; Sun, 17 Jul 2005 11:07:00 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j6HE6tGn012158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 17 Jul 2005 08:06:58 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j6HE6tOn009717; Sun, 17 Jul 2005 08:06:55 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j6HE6t7c009716; Sun, 17 Jul 2005 08:06:55 -0600 (MDT) (envelope-from mfuhr) Date: Sun, 17 Jul 2005 08:06:55 -0600 From: Michael Fuhr To: Tsirkin Evgeny Cc: pgsql-admin@postgresql.org Subject: Re: caching table/query Message-ID: <20050717140655.GA9637@winnie.fuhr.org> References: <42DA3A4C.3080009@mail.jct.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42DA3A4C.3080009@mail.jct.ac.il> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/113 X-Sequence-Number: 18169 On Sun, Jul 17, 2005 at 02:00:28PM +0300, Tsirkin Evgeny wrote: > > I have several pretty little tables (~300 - 400 records) which are > queried very frequently. > I would like to make postrgres be aware of this and do a in memory cache > for it . PostgreSQL maintains a buffer cache in shared memory; if you enable statistics gathering then you can see how effective it is for the tables in question: http://www.postgresql.org/docs/8.0/static/monitoring-stats.html If the tables are small and you're querying them frequently, and if shared_buffers is adequately sized, then I'd expect most or all queries to be satisfied from the buffer cache. Those that aren't might still be satisfied from the OS's cache. Are you experiencing performance problems? Presumably that's the real problem you're trying to solve. -- Michael Fuhr http://www.fuhr.org/~mfuhr/