Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 30DE11337B67 for ; Wed, 17 Nov 2010 14:37:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 26027-03 for ; Wed, 17 Nov 2010 18:37:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og109.obsmtp.com (exprod7og109.obsmtp.com [64.18.2.171]) by mail.postgresql.org (Postfix) with SMTP id 652B61337B7E for ; Wed, 17 Nov 2010 14:37:46 -0400 (AST) Received: from source ([209.85.215.54]) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKTOQg+bhZj8P6RwRXjnwNwAmH2lmdnoKF@postini.com; Wed, 17 Nov 2010 10:37:46 PST Received: by ewy3 with SMTP id 3so1404073ewy.13 for ; Wed, 17 Nov 2010 10:37:45 -0800 (PST) Received: by 10.213.9.140 with SMTP id l12mr2725615ebl.13.1290019063730; Wed, 17 Nov 2010 10:37:43 -0800 (PST) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id b52sm2523956eei.13.2010.11.17.10.37.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 17 Nov 2010 10:37:42 -0800 (PST) Message-ID: <4CE420F6.7070003@enterprisedb.com> Date: Wed, 17 Nov 2010 20:37:42 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: Tom Lane CC: Elliott Groszek , pgsql-bugs@postgresql.org Subject: Re: BUG #5755: Query Optimzer Bug References: <201011162239.oAGMd7ZR045353@wwwmaster.postgresql.org> <27568.1290009930@sss.pgh.pa.us> In-Reply-To: <27568.1290009930@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201011/122 X-Sequence-Number: 28702 On 17.11.2010 18:05, Tom Lane wrote: > "Elliott Groszek" writes: >> The following SQL statements produce different query plans even though >> "phone" is not reference in the SQL! > >> explain update customer set login_name = >> (select "NESSOuserName" from person,phone >> where person.cac_cert=customer.cac_cert); > >> explain update customer set login_name = >> (select "NESSOuserName" from person >> where person.cac_cert=customer.cac_cert); > > That's not a bug. Particularly, note that they produce different results if "phone" table is empty. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com