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 AFD98D1B1CD for ; Fri, 21 May 2004 11:42:16 -0300 (ADT) 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 90361-06 for ; Fri, 21 May 2004 11:42:00 -0300 (ADT) Received: from fep15.012.net.il (fep15.012.net.il [212.117.129.240]) by svr1.postgresql.org (Postfix) with ESMTP id 48F04D1B1F8 for ; Fri, 21 May 2004 11:41:54 -0300 (ADT) Received: from [127.0.0.1] ([80.178.88.219]) by fep15.012.net.il with ESMTP id <20040521144039.KEXY7406.fep15@[80.178.88.219]> for ; Fri, 21 May 2004 17:40:39 +0300 Received: from [127.0.0.1] ([127.0.0.1]) by [127.0.0.1] with ESMTP (SpamPal v1.50) sender ; 21 May 2004 17:42:09 +0300 Date: Fri, 21 May 2004 17:42:09 +0300 From: Vitaly Belman Reply-To: Vitaly Belman X-Priority: 3 (Normal) Message-ID: <40782517171.20040521174209@012.net.il> To: Postgresql Performance Subject: PostgreSQL caching MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.8 tagged_above=0.0 required=5.0 tests=PRIORITY_NO_NAME X-Spam-Level: X-Archive-Number: 200405/179 X-Sequence-Number: 7010 Hello, I have the following problem: When I run some query after I just run the Postmaster, it takse several seconds to execute (sometimes more than 10), if I rerun it again afterwards, it takes mere milliseconds. So, I guess it has to do with PostgreSQL caching.. But how exactly does it work? What does it cache? And how can I control it? I would like to load selected information in the memory before a user runs the query. Can I do it somehow? As PostgreSQL is used in my case as webserver, it isn't really helping if the user has to wait 10 seconds every time he goes to a new page (even if refreshing the page would be really quick, sine Postgre already loaded the data to memory). P.S If the query or its EXPLAIN are critical for a better understanding, let me know. Regards, Vitaly Belman ICQ: 1912453 AIM: VitalyB1984 MSN: tmdagent@hotmail.com Yahoo!: VitalyBe