X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8A624DA981 for ; Thu, 22 Sep 2005 13:16:24 -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 12572-08 for ; Thu, 22 Sep 2005 16:16:22 +0000 (GMT) Received: from smtp3.freeserve.com (smtp3.wanadoo.co.uk [193.252.22.156]) by svr1.postgresql.org (Postfix) with ESMTP id 98F1FDA9A8 for ; Thu, 22 Sep 2005 13:16:21 -0300 (ADT) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3208.me.freeserve.com (SMTP Server) with ESMTP id 99D0D740008E; Thu, 22 Sep 2005 18:16:18 +0200 (CEST) Received: from 192.168.0.102 (modem-1130.llama.dialup.pol.co.uk [217.135.180.106]) by mwinf3208.me.freeserve.com (SMTP Server) with ESMTP id 2EF26740008D; Thu, 22 Sep 2005 18:16:18 +0200 (CEST) X-ME-UUID: 20050922161618192.2EF26740008D@mwinf3208.me.freeserve.com Subject: Re: SELECT LIMIT 1 VIEW Performance Issue From: Simon Riggs To: K C Lau Cc: pgsql-performance@postgresql.org In-Reply-To: <6.2.1.2.0.20050922221846.02c45fb8@localhost> References: <6.2.1.2.0.20050615100524.04f9d6a8@localhost> <6.2.1.2.0.20050922102035.07bcf2e0@localhost> <1127378456.4145.76.camel@localhost.localdomain> <6.2.1.2.0.20050922181009.02c36ca8@localhost> <1127393284.4145.109.camel@localhost.localdomain> <6.2.1.2.0.20050922221846.02c45fb8@localhost> Content-Type: text/plain Organization: 2nd Quadrant Date: Thu, 22 Sep 2005 17:16:23 +0100 Message-Id: <1127405783.4145.113.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.052 required=5 tests=[AWL=0.002, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/242 X-Sequence-Number: 14550 On Thu, 2005-09-22 at 22:39 +0800, K C Lau wrote: > >Is a 51ms query really such a problem for you? > > Unfortunately yes, as our target performance is in the high hundreds of > transactions per sec. And 51 ms is already the best case for a single > select, with everything cached in memory immediately after the same select > which took 390 ms on a quiet system. If the current value is used so often, use two tables - one with a current view only of the row maintained using UPDATE. Different performance issues maybe, but at least not correlated subquery ones. Best Regards, Simon Riggs