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 04D2FD1B531; Tue, 14 Oct 2003 17:38:01 +0000 (GMT) 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 51330-08; Tue, 14 Oct 2003 14:37:30 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id F03A5D1B4F1; Tue, 14 Oct 2003 14:37:28 -0300 (ADT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.10/8.12.10) with ESMTP id h9EHaNXk026762; Tue, 14 Oct 2003 11:36:24 -0600 (MDT) Date: Tue, 14 Oct 2003 11:26:45 -0600 (MDT) From: "scott.marlowe" To: Wei Weng Cc: Christopher Kings-Lynne , Chris Faulkner , Pgsql-Performance , Pgsql-Sql Subject: Re: [SQL] sql performance and cache In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IHS-MailScanner: Found to be clean X-IHS-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/459 X-Sequence-Number: 4207 On Tue, 14 Oct 2003, Wei Weng wrote: > On Sat, 11 Oct 2003, Christopher Kings-Lynne wrote: > > > > > > I have two very similar queries which I need to execute. They both have > > > exactly the same from / where conditions. When I execute the first, it takes > > > about 16 seconds. The second is executed almost immediately after, it takes > > > 13 seconds. In short, I'd like to know why the query result isn't being > > > cached and any ideas on how to improve the execution. > > > > > > > > > OK - so I could execute the query once, and get the maximum size of the > > > array and the result set in one. I know what I am doing is less than optimal > > > but I had expected the query results to be cached. So the second execution > > > would be very quick. So why aren't they ? I have increased my cache size - > > > shared_buffers is 2000 and I have doubled the default max_fsm... settings > > > (although I am not sure what they do). sort_mem is 8192. > > > > PostgreSQL does not have, and has never had a query cache - so nothing > > you do is going to make that second query faster. > > > > Perhaps you are confusing it with the MySQL query cache? > > > > Chris > > > Is there plan on developing one (query cache)? Not really, Postgresql's design makes it a bit of a non-winner.