X-Original-To: pgsql-general@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 65FA24758E6 for ; Thu, 13 Feb 2003 23:45:27 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 56649474E61 for ; Thu, 13 Feb 2003 23:45:26 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1E4jT5u004170; Thu, 13 Feb 2003 23:45:29 -0500 (EST) To: Greg Stark Cc: Stephan Szabo , pgsql-general@postgresql.org Subject: Re: index scan with index cond on first column doesn't recognize sort order of second column In-reply-to: <877kc3jxsb.fsf@stark.dyndns.tv> References: <20030213113156.T47380-100000@megazone23.bigpanda.com> <87u1f7kf1y.fsf@stark.dyndns.tv> <1915.1045178941@sss.pgh.pa.us> <87isvnk708.fsf@stark.dyndns.tv> <3081.1045187252@sss.pgh.pa.us> <877kc3jxsb.fsf@stark.dyndns.tv> Comments: In-reply-to Greg Stark message dated "13 Feb 2003 23:23:16 -0500" Date: Thu, 13 Feb 2003 23:45:29 -0500 Message-ID: <4169.1045197929@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/755 X-Sequence-Number: 37509 Greg Stark writes: > Tom Lane writes: >> Actually you are barking up the wrong tree entirely; I'm pretty certain >> that truncate_useless_pathkeys *doesn't* remove this pathkey, because it >> should notice that it is relevant to the mergejoin condition. > No, truncate_useless_pathkeys actually returns NULL. Mmm, you're right. It would accept the second pathkey if it got to it --- but it doesn't, because the first pathkey (col1) isn't useful for any merge condition. Still, truncate_useless_pathkeys isn't the place to be dealing with this issue. It's not in a position to generate multiple interpretations of the same path, which is what we are really after here. regards, tom lane