X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 5FD579DCDC5 for ; Thu, 12 Jan 2006 12:25:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 78485-03-2 for ; Thu, 12 Jan 2006 12:25:50 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from uproxy.gmail.com (uproxy.gmail.com [66.249.92.193]) by postgresql.org (Postfix) with ESMTP id 7A9569DCDBF for ; Thu, 12 Jan 2006 12:25:49 -0400 (AST) Received: by uproxy.gmail.com with SMTP id s2so129123uge for ; Thu, 12 Jan 2006 08:25:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=Q8mJooaVSVzv74bMm1EylBp/n+knXQzKHwh4jtoIPbHXIIOverpUWBJjACAYSCk0Muzd3S0XADdtLy0CTryJIKaHd0Lm/K47qR17rJUHszH4QJI6ALDY79RJ6zmIOjRgtmj8m0R1TOtM27BwcJn5I6krZLJDz7r358Cran5vjbs= Received: by 10.66.255.3 with SMTP id c3mr289363ugi; Thu, 12 Jan 2006 08:25:48 -0800 (PST) Received: from ?192.168.3.4? ( [81.182.248.121]) by mx.gmail.com with ESMTP id k2sm1034082ugf.2006.01.12.08.25.47; Thu, 12 Jan 2006 08:25:48 -0800 (PST) Message-ID: <43C682F5.4000001@gmail.com> Date: Thu, 12 Jan 2006 17:25:25 +0100 From: =?ISO-8859-2?Q?Sz=FBcs_G=E1bor?= User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Throwing unnecessary joins away References: <34608c0c0601120418n1af567b9n@mail.gmail.com> <43C64CFB.9030504@barettadeit.com> <34608c0c0601120541wd910da3s@mail.gmail.com> <5269.1137081233@sss.pgh.pa.us> In-Reply-To: <5269.1137081233@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.786 required=5 tests=[AWL=-0.546, RCVD_IN_BL_SPAMCOP_NET=1.332] X-Spam-Score: 0.786 X-Spam-Level: X-Archive-Number: 200601/157 X-Sequence-Number: 16635 Dear Tom, Not sure about Otto's exact problem, but he did mention views, and I'd feel more comfortable if you told me that view-based queries are re-planned based on actual conditions etc. Are they? Also, if you find it unlikely (or very rare) then it might be a configurable parameter. If someone finds it drastically improving (some of) their queries, it'd be possible to enable this feature in expense of extra planner cycles (on all queries). What I'd be concerned about, is whether the developers' time spent on this feature would worth it. :) -- G. On 2006.01.12. 16:53, Tom Lane wrote: > =?ISO-8859-1?Q?Ott=F3_Havasv=F6lgyi?= writes: >> As far as I know SQL Server has some similar feature. It does not join >> if not necessary, more exactly: if the result would be the same if it >> joined the table. > > I find it really really hard to believe that such cases arise often > enough to justify having the planner spend cycles checking for them. > > regards, tom lane