Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 48F52650121 for ; Tue, 2 Sep 2008 08:46:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 07995-03 for ; Tue, 2 Sep 2008 08:46:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail137087.authsmtp.net (outmail137087.authsmtp.net [62.13.137.87]) by postgresql.org (Postfix) with ESMTP id EED7A64FFF8 for ; Tue, 2 Sep 2008 08:46:37 -0300 (ADT) Received: from mail-c187.authsmtp.com (mail-c187.authsmtp.com [62.13.128.33]) by punt4.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m82Bk1oM013278; Tue, 2 Sep 2008 12:46:01 +0100 (BST) Received: from [192.168.0.2] (85-211-229-97.dyn.gotadsl.co.uk [85.211.229.97]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m82BjwIb047614; Tue, 2 Sep 2008 12:45:59 +0100 (BST) Subject: Re: WIP Join Removal From: Simon Riggs To: Gregory Stark Cc: Heikki Linnakangas , List pgsql-patches In-Reply-To: <87od36u7st.fsf@oxford.xeocode.com> References: <1220176372.4371.118.camel@ebony.2ndQuadrant> <48BC4127.30706@enterprisedb.com> <1220348487.4371.307.camel@ebony.2ndQuadrant> <48BD1374.4030504@enterprisedb.com> <1220352112.4371.349.camel@ebony.2ndQuadrant> <48BD1852.1070904@enterprisedb.com> <1220352898.4371.355.camel@ebony.2ndQuadrant> <87od36u7st.fsf@oxford.xeocode.com> Content-Type: text/plain Date: Tue, 02 Sep 2008 12:53:50 +0100 Message-Id: <1220356430.4371.382.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: b62a5879-78e4-11dd-8155-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFaAdbflxB HGQLW1xEUV97XWZ/ bgMfZQBDYEtPQQdo WVZARU1QEQdtHhxP WxYcIEM1DldGfHl2 ZEIsX3RbVQooc0Qs R0ZTHHABbTJkdWEe BBRFfwJRdR5Kfh5E YlUrV3QKMjRJBC9q VzASB3gTOjRZYB5Y RwYTJFZ6 X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:1186/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse 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=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/15 X-Sequence-Number: 7030 On Tue, 2008-09-02 at 12:05 +0100, Gregory Stark wrote: > I wonder if it would be more worthwhile to remove them and have a > subsequent phase where we look for possible joins to *add*. So even if > the user writes > "select * from invoices where customer_id=?" the planner might be able > to discover that it can find those records quicker by scanning > customer, finding the matching and then using > an index to look them up in invoices. That's a good idea. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support