X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 774389F944D for ; Mon, 15 May 2006 05:48:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 46388-04 for ; Mon, 15 May 2006 05:48:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sand1.gxn.net (sand1.gxn.net [195.147.249.207]) by postgresql.org (Postfix) with ESMTP id EAFC79F9430 for ; Mon, 15 May 2006 05:48:47 -0300 (ADT) Received: from [62.232.55.118] (helo=[192.168.0.2]) by sand1.gxn.net with esmtp (Exim 4.50) id 1FfYne-0006rx-ND; Mon, 15 May 2006 09:51:35 +0100 Subject: Re: Wrong plan for subSELECT with GROUP BY From: Simon Riggs To: Tom Lane Cc: pgsql-performance@postgresql.org In-Reply-To: <23992.1147442716@sss.pgh.pa.us> References: <446482E4.6050906@ritek.hu> <23992.1147442716@sss.pgh.pa.us> Content-Type: text/plain Date: Mon, 15 May 2006 09:48:33 +0100 Message-Id: <1147682913.3465.232.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-4.fc4) Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/335 X-Sequence-Number: 19122 On Fri, 2006-05-12 at 10:05 -0400, Tom Lane wrote: > Antal Attila writes: > > If this is a deficiency of the planner, I'd like to suggest this feature > > into the planner. > > This really falls into the category of "you've got to be kidding". Agreed > There's no way that it'd be reasonable for the planner to expend cycles > on every query to look for corner cases like this. OT: Should we have a way of telling the optimizer how much time and effort we would like it to go to? Some of the new optimizations and many yet to come cover smaller and smaller sub-cases. At least internally, we could mark the cost-of-optimization as we go, so we can play with the external interface later. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com