X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id F3AE7D1B516 for ; Sat, 11 Oct 2003 10:17:22 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 31948-08 for ; Sat, 11 Oct 2003 07:16:42 -0300 (ADT) Received: from relay01.kbs.net.au (149.32.220.203.comindico.com.au [203.220.32.149]) by svr1.postgresql.org (Postfix) with ESMTP id 68022D1B50D for ; Sat, 11 Oct 2003 07:16:35 -0300 (ADT) Received: from [203.221.127.74] (helo=familyhealth.com.au) by relay01.kbs.net.au with esmtp (Exim 3.36 #1) id 1A8Gnj-0001TJ-00; Sat, 11 Oct 2003 20:16:43 +1000 Message-ID: <3F87D883.2000206@familyhealth.com.au> Date: Sat, 11 Oct 2003 18:16:35 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Christopher Kings-Lynne Cc: Chris Faulkner , Pgsql-Performance Subject: Re: sql performance and cache References: <3F87D764.8030306@familyhealth.com.au> In-Reply-To: <3F87D764.8030306@familyhealth.com.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/385 X-Sequence-Number: 4133 > PostgreSQL does not have, and has never had a query cache - so nothing > you do is going to make that second query faster. Let me clarify that. PostgreSQL will of course cache the disk pages used in getting the data for your query, which is why the second time you run it, it is 3 seconds faster. However, it does not cache the _results_ of the query. Each time you run it, it will be fully re-evaluated. The btree error you give is bad and I'm sure the more experienced list members will want you to dig into it for them. Chris