Re: index scan with index cond on first column doesn't recognize sort order of second column - Mailing list pgsql-general

From Tom Lane
Subject Re: index scan with index cond on first column doesn't recognize sort order of second column
Date
Msg-id 4169.1045197929@sss.pgh.pa.us
Whole thread Raw
In response to Re: index scan with index cond on first column doesn't recognize sort order of second column  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
Greg Stark <gsstark@mit.edu> writes:
> Tom Lane <tgl@sss.pgh.pa.us> 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: index scan with index cond on first column doesn't recognize sort order of second column
Next
From: Egyud Csaba
Date:
Subject: Re: set returning functions in v7.3 - SORRY