Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id EB925633E58 for ; Mon, 29 Mar 2010 12:34:12 -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 99995-07 for ; Mon, 29 Mar 2010 15:33:59 +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 7069D63404E for ; Mon, 29 Mar 2010 12:32:05 -0300 (ADT) Received: by fxm25 with SMTP id 25so116285fxm.3 for ; Mon, 29 Mar 2010 08:32:04 -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 :content-transfer-encoding; bh=wJUUrSZiEVsx3nh3neafQniLP9ZFAloQH/7p0rhqqLs=; b=YKvdgI3+96nj+xWX2NG7EpkRvZSz8u19wZLJA8vDgHILGHNehtXc6r/F3M3HLeK4J3 sBUaUIpuj+PUpranQcI+CNlyhXBsRqIWZVPCeeey/CMBNBM6KVfjpC2E0pttLKutVC1F TGMsHf0P6RA0lg1pfEDEfUkUoG6F8ET8+jgZQ= 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:content-transfer-encoding; b=SMDOWjOS4sMfWJwJw5bFVjyaxsmURJw35KylfNE3PucmUJGISuYTrX32DTnYexecL8 tk01E/DbgpEkXbL6yh4MaB/I+oQ4/b38dl/jGjJ9HjO6iTi+jptN7zxJgii7jpySgzQJ qg48tD0YEvnzJBf+9k7o6/FP2juUpgoKJDttA= MIME-Version: 1.0 Received: by 10.239.161.83 with HTTP; Mon, 29 Mar 2010 08:32:04 -0700 (PDT) In-Reply-To: <13795.1269876446@sss.pgh.pa.us> References: <1269851630.3684.3636.camel@ebony> <603c8f071003290637q14d431f7j90afabd6fd2ec952@mail.gmail.com> <12679.1269873374@sss.pgh.pa.us> <603c8f071003290820h3553d223le3b5228f789608f9@mail.gmail.com> <13795.1269876446@sss.pgh.pa.us> Date: Mon, 29 Mar 2010 11:32:04 -0400 Received: by 10.239.142.211 with SMTP id h19mr406379hba.164.1269876724120; Mon, 29 Mar 2010 08:32:04 -0700 (PDT) Message-ID: <603c8f071003290832u23130f2x84ffa459e312269c@mail.gmail.com> Subject: Re: enable_joinremoval From: Robert Haas To: Tom Lane Cc: Simon Riggs , pgsql-hackers@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.482 tagged_above=-10 required=5 tests=AWL=0.117, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/1148 X-Sequence-Number: 159924 On Mon, Mar 29, 2010 at 11:27 AM, Tom Lane wrote: > Robert Haas writes: >> And for the record, I believe I find it rather amusing that you're >> asking me if I "have the faintest idea how many there would be". > > Actually that was directed more at Simon. > >> I venture to say that after yourself I might be the person who knows >> this code best. =A0I know how many there will be, if I get my way, and >> that number is two. > > If you're speaking of adding a switch for the materialize-insertion > behavior, I didn't object to that; I agree that turning that off might > be an interesting thing to do. =A0But I remain of the opinion that a > switch to disable join removal is just useless code and user-visible > complexity. OK, I'll write a patch for that; and a consensus emerges that we should also have enable_joinremoval, then I will add that as well. I think the only argument for NOT having enable_joinremoval is that you can always modify the query to say SELECT * rather than some more specific SELECT list, but I think when there are several levels of views involved it may not be so simple - you'll have to define temporary versions of all the intermediate views, which is possibly somewhat painful and certainly error-prone. ...Robert