• Tom Lane's avatar
    Teach the planner to remove SubqueryScan nodes from the plan if they · e2159f38
    Tom Lane authored
    aren't doing anything useful (ie, neither selection nor projection).
    Also, extend to SubqueryScan the hacks already in place to avoid
    unnecessary ExecProject calls when the result would just be the same
    tuple the subquery already delivered.  This saves some overhead in
    UNION and other set operations, as well as avoiding overhead for
    unflatten-able subqueries.  Per example from Sokolov Yura.
    e2159f38
prepunion.c 33.2 KB