pgsql: Fix get_useful_pathkeys_for_relation for volatile expressions

2020-11-03 Thread Tomas Vondra
Fix get_useful_pathkeys_for_relation for volatile expressions When considering Incremental Sort below a Gather Merge, we need to be a bit more careful when matching pathkeys to EC members. It's not enough to find a member whose Vars are all in the current relation's target; volatile expressions in

pgsql: Fix get_useful_pathkeys_for_relation for volatile expressions

2020-11-03 Thread Tomas Vondra
Fix get_useful_pathkeys_for_relation for volatile expressions When considering Incremental Sort below a Gather Merge, we need to be a bit more careful when matching pathkeys to EC members. It's not enough to find a member whose Vars are all in the current relation's target; volatile expressions in