Kyotaro HORIGUCHI <horiguchi.kyot...@lab.ntt.co.jp> writes: > Oops! I found a bug in this patch. The previous v8 patch missed > the case that build_index_pathkeys() could build a partial > pathkeys from the index tlist.
TBH I think that's barely the tip of the iceberg of cases where this patch will get the wrong answer. It looks like it thinks that *any* Var belonging to the indexed relation must be the same one indexed by the index. Also, I don't see it doing anything to check the ordering of multiple index columns --- for instance, an index on (a,b) and one on (b,a) would both pass or fail identically, though surely only one should match "ORDER BY a,b,...". Also, what's with the success return before the loop: + if (list_length(pathkeys) == list_length(root->query_pathkeys)) + return true; At this point you haven't proven *anything at all* about whether the index columns have something to do with the query_pathkeys. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers