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 A955B52825 for ; Sun, 17 Jul 2005 11:55:08 -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 04327-03 for ; Sun, 17 Jul 2005 14:54:59 +0000 (GMT) Received: from mail1.cc.huji.ac.il (mail1.cc.huji.ac.il [132.64.1.17]) by svr1.postgresql.org (Postfix) with ESMTP id 9823152824 for ; Sun, 17 Jul 2005 11:54:57 -0300 (ADT) Received: from mail1.cc.huji.ac.il (localhost [127.0.0.1]) by mail1.cc.huji.ac.il (Postfix) with SMTP id 46EA81E7AE3; Sun, 17 Jul 2005 17:54:59 +0300 (IDT) Received: by mail1.cc.huji.ac.il (Postfix, from userid 31998) id 3DAB71E7A1E; Sun, 17 Jul 2005 17:54:59 +0300 (IDT) Received: from [132.64.52.127] (evegeni.mm.huji.ac.il [132.64.52.127]) by mail1.cc.huji.ac.il (Postfix) with ESMTP id DBB701E7AE5; Sun, 17 Jul 2005 17:54:55 +0300 (IDT) Message-ID: <42DA7226.5070808@mail.jct.ac.il> Date: Sun, 17 Jul 2005 17:58:46 +0300 From: Tsirkin Evgeny User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Fuhr Cc: Tsirkin Evgeny , pgsql-admin@postgresql.org Subject: Re: caching table/query References: <42DA3A4C.3080009@mail.jct.ac.il> <20050717140655.GA9637@winnie.fuhr.org> In-Reply-To: <20050717140655.GA9637@winnie.fuhr.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus: scanned by VAMS 2005 version 8.797 from Sat Jul 16 23:42:48 2005 CEST X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200507/114 X-Sequence-Number: 18170 Michael Fuhr wrote: >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. > > Well, that is currently only development stage so i can't realy know if there will be any perfomence problems. But i am looking for a way to be sure i will not have one.And since i already know what queries and tables i want to cache those .Just saing to my boss " when we there will be performance problems the postgresql will solve it " would not do it.The case is that when runnig a test i am getting penalty for requesting the table,of course the test does query only once so i can't see the cache in work . What i realy want is to say to postgres that the particular table should be cached . Thanks.