Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id A2CC147590F for ; Thu, 25 Apr 2002 12:57:11 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g3PGvBF02333; Thu, 25 Apr 2002 12:57:11 -0400 (EDT) To: Daniel Lundin Cc: pgsql-sql@postgresql.org Subject: Re: Again: Identity not discovered by planner? In-reply-to: <20020425130838.GA1495@shire> References: <20020425130838.GA1495@shire> Comments: In-reply-to Daniel Lundin message dated "Thu, 25 Apr 2002 15:08:38 +0200" Date: Thu, 25 Apr 2002 12:57:10 -0400 Message-ID: <2329.1019753830@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200204/311 X-Sequence-Number: 7575 Daniel Lundin writes: > I would have thought that the planner would notice that child.parent = > parent.id = 1193, implies that child.parent = 1193, Nope, it does not. It will notice transitive equality of variables, but that happens to fall out of processing that it has to do anyway to recognize sort keys for mergejoins. Constants aren't interesting for join planning so they are not handled in that code. Offhand I do not see a way of recognizing this case that wouldn't expend a great deal more cycles than it's likely to be worth. regards, tom lane