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 992645287E for ; Wed, 20 Jul 2005 04:22:13 -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 99300-03 for ; Wed, 20 Jul 2005 07:22:08 +0000 (GMT) Received: from mail2.cc.huji.ac.il (real-outmail.cc.huji.ac.il [132.64.1.18]) by svr1.postgresql.org (Postfix) with ESMTP id 41CFA52993 for ; Wed, 20 Jul 2005 04:22:07 -0300 (ADT) Received: from mail2.cc.huji.ac.il (localhost [127.0.0.1]) by mail2.cc.huji.ac.il (Postfix) with SMTP id C4F801DEF9C; Wed, 20 Jul 2005 10:22:05 +0300 (IDT) Received: by mail2.cc.huji.ac.il (Postfix, from userid 31998) id BEFE71DEFDC; Wed, 20 Jul 2005 10:22:05 +0300 (IDT) Received: from [132.64.52.127] (evegeni.mm.huji.ac.il [132.64.52.127]) by mail2.cc.huji.ac.il (Postfix) with ESMTP id 40C991DEF9C; Wed, 20 Jul 2005 10:22:05 +0300 (IDT) Message-ID: <42DDFC87.1000807@mail.jct.ac.il> Date: Wed, 20 Jul 2005 10:25:59 +0300 From: Tsirkin Evgeny User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Chris Travers Cc: Tsirkin Evgeny , pgsql-admin@postgresql.org Subject: Re: caching table/query References: <42DA3A4C.3080009@mail.jct.ac.il> <20050717140655.GA9637@winnie.fuhr.org> <42DA7226.5070808@mail.jct.ac.il> <28088.1121615607@sss.pgh.pa.us> <42DB4DE2.6090304@mail.jct.ac.il> <42DDEC2C.9050009@metatrontech.com> In-Reply-To: <42DDEC2C.9050009@metatrontech.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus: scanned by VAMS 2005 version 8.800 from Tue Jul 19 16:15:35 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/143 X-Sequence-Number: 18199 Well ,here is something that might be interesting: trying to reduce query time and since that is a web application i now using caching with perl MLDBM::Sync::SDBM_File on application level .(Basically that involves quering all the table and putting it into MLDBM::Sync::SDBM_File and then quering it back ) .What is interesting is that while time quering the tables from postgres is taken 0.3 sec. using sdbm it takes 0.1 sec. Actually i am not anymore sure that postgres does NOT cache table in memory, maybe it does and i don't know about it?Maybe the time is spended in transmitting the data from postgres to the application? How can i test this? Thanks. Chris Travers wrote: > Tsirkin Evgeny wrote: > >> >> Well i guess that there are cases where that is not so.However i >> understand that postgres does not have any way accept >> the automatic. > > > Largely true. There may be ways of forcing a from-memory query once > the system is in place, but I am not sure that this is always what you > want, it would not be pretty, and might have some real performance > issues. My suggestion is that you wait until your system is in > operation and then look first for general tuning help before you even > consider trying to impliment a memory-cached table in your application. > > Just for the record, I can think of at least one way of hacking this > on, but it seems like it should be an absolutely last resort rather > than a first impulse. > > PostgreSQL can do this, but you probably don't want it to. > > Best Wishes, > Chris Travers