On Fri, Sep 25, 2026 at 8:43 PM Ayush Tiwari <[email protected]> wrote: > Would it make sense to skip PHVs during that argument walk too, > while still processing other SubLinks in the argument? The attached > patch tries that, with small tests for sum() and GROUPING().
Skipping PHVs in build_subplan looks right to me. Any PHV found within the arguments of an outer-level Aggref is a pushed-down copy that its owning level has already preprocessed, so there is nothing left to do in it. The flag looks ugly though, but I don't have a better fix than that. I plan to push this fix soon if there are no objections. - Richard
