make_sort_from_pathkeys()'s method for choosing which of several
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 29 Feb 2004 17:36:48 +0000 (17:36 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 29 Feb 2004 17:36:48 +0000 (17:36 +0000)
commit201b3833bae61c90eaca1b6398c6a8356c149b62
tree29818d26dc585e4c0ca4e4d503e89caf312c5d27
parent045a2e7ac19df1c301abf55f8cc33942de84b3f6
make_sort_from_pathkeys()'s method for choosing which of several
equivalent sort expressions to use was broken: you can't just look
at the relation membership, you have to actually grovel over the
individual Vars in each expression.  I think this did work when it
was written, but it was broken by subsequent optimizations that made
join relations not propagate every single input variable upward.
Must find the Var that got propagated, not choose one at random.
Per bug report from Daniel O'Neill.
src/backend/optimizer/plan/createplan.c