Hi,
can someone point out to me, why we don't consider pushdowns of the joinqual for these queries beyond the distinct on? When the qual matches the distinct clause, it should be possible to generate both parametrized and non parametrized subplans for the same query. The same should hold true for aggregates, if the group by clause matches. Is there any specific reason we aren't doing that already? Regards Arne
distinct_on_lateral.sql
Description: distinct_on_lateral.sql