Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D0BF26324E2 for ; Mon, 29 Mar 2010 10:37:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 81824-06 for ; Mon, 29 Mar 2010 13:37:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by mail.postgresql.org (Postfix) with ESMTP id 8CBB4632267 for ; Mon, 29 Mar 2010 10:37:35 -0300 (ADT) Received: by fxm25 with SMTP id 25so15881fxm.3 for ; Mon, 29 Mar 2010 06:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=dAj/lisQ28HTMWcT01SggfiofDSBjKS0fLFC/6gFnME=; b=fF6C0z2q/+pMjjtchWD564CXTh7Z3+RBVfG5Z4HUyM7AbibppXHClaGXsVmy23398c zyJGS/uViXb2sVW7tlVvha2gCZVG9RYHXpzX2Hy2khDf/VVxnCrx+2c00ZoPn7GyK143 yrJQTqT2jaKSzJdt45ySslDK3rbvecS1shIac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=SP5BpbY+GwXtUPBVxNGB6xqou+T+yE0dzy0HliG9T4f1HzV/2j/PWVhuOMAQpTcDuz rqSuxEXr+hF5grp5lUGO+U9AuQR2YJ5sNaKi0VlTW7bLK0wu4jiF01LbEbjcLRgdE0yp fCOp65DJyovw+T7OZy1YX3SE81IFF1RemC1co= MIME-Version: 1.0 Received: by 10.239.161.83 with HTTP; Mon, 29 Mar 2010 06:37:33 -0700 (PDT) In-Reply-To: <1269851630.3684.3636.camel@ebony> References: <1269851630.3684.3636.camel@ebony> Date: Mon, 29 Mar 2010 09:37:33 -0400 Received: by 10.239.191.211 with SMTP id c19mr451920hbi.18.1269869853290; Mon, 29 Mar 2010 06:37:33 -0700 (PDT) Message-ID: <603c8f071003290637q14d431f7j90afabd6fd2ec952@mail.gmail.com> Subject: Re: enable_joinremoval From: Robert Haas To: Simon Riggs Cc: pgsql-hackers@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.481 tagged_above=-10 required=5 tests=AWL=0.118, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/1136 X-Sequence-Number: 159912 On Mon, Mar 29, 2010 at 4:33 AM, Simon Riggs wrote: > > We have planner method parameters for many important parts of the > planner. We don't have any parameter for join removal, AFAIK. > > The first question I get asked is "can I see the tables it removed?". > This has been asked of me 3 times now this year, always first question. > Same issue applies to constraint exclusion. > > But we *can* do this with constraint_exclusion, simply by turning it off > and checking the two outputs. > > So I think we need a parameter for join removal also. > > I don't want to turn it off, but I think we need a way for people to > check themselves that the removal of the joins is not an error. I > foresee many false bug reports along the lines of "optimizer ate my join > and I want it back". I had this in my original patch but Tom wanted it taken out. In many cases it's not horribly difficult to work around because you can do SELECT * FROM ... instead of your original select list, but there might be some cases with multiple levels of views where it isn't that easy. I think it would be good to add this back. An even worse problem I've been noticing is that there is no easy way to determine whether the planner's new penchant for inserting Materialize notes in all sorts of fun and exciting places is in fact improving performance or not. I'm not sure there's even a difficult way. I really, really think we need to do something out this - the current situation is really quite horrible. ...Robert