Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 53BCA633515 for ; Mon, 29 Mar 2010 05:34:29 -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 35631-04 for ; Mon, 29 Mar 2010 08:34:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail148154.authsmtp.co.uk (outmail148154.authsmtp.co.uk [62.13.148.154]) by mail.postgresql.org (Postfix) with ESMTP id 08C6E63321A for ; Mon, 29 Mar 2010 05:34:05 -0300 (ADT) Received: from mail-c194.authsmtp.com (mail-c194.authsmtp.com [62.13.128.121]) by punt6.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id o2T8Y4pL046865 for ; Mon, 29 Mar 2010 09:34:04 +0100 (BST) Received: from [192.168.0.2] (88-110-156-192.dynamic.dsl.as9105.com [88.110.156.192]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id o2T8XoBg022254 for ; Mon, 29 Mar 2010 09:33:51 +0100 (BST) Subject: enable_joinremoval From: Simon Riggs To: pgsql-hackers@postgresql.org Content-Type: text/plain Date: Mon, 29 Mar 2010 09:33:50 +0100 Message-Id: <1269851630.3684.3636.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Server-Quench: cd9ed0df-3b0d-11df-80b9-0022640b883e X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MOFUSTAAU Mk9RLVdJK3UEQkpF VCReGBUITgIzDi13 YhUsPEdCYEpPXxVq WUJKQVhXFUtgCQIA Bx4AUxx0aQRPemF1 bUF9Xj4EXiByHRkP FU5WF28DYSlhaGQY HhMMflYAcFccYxwX agRiVXJZN3gPZihp WldrZWpvYW1VeHQO TxcAK1sYRUs8HDk9 QQoPGDIxFElt X-Authentic-SMTP: 61633235383639.1015:706/Kp X-AuthFastPath: 255 X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.407 tagged_above=-10 required=5 tests=AWL=0.192, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/1124 X-Sequence-Number: 159900 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". -- Simon Riggs www.2ndQuadrant.com