Re: Unfortunate pushing down of expressions below sort - Mailing list pgsql-hackers

From Chengpeng Yan
Subject Re: Unfortunate pushing down of expressions below sort
Date
Msg-id 13636E54-C27A-4A49-926D-B9E3EBAA8A10@Outlook.com
Whole thread Raw
In response to Re: Unfortunate pushing down of expressions below sort  (Chengpeng Yan <chengpeng_yan@Outlook.com>)
List pgsql-hackers
Hi,

I've attached v2 of the patch.

Changes since v1:
- No planner logic changes.
- Fixed one regression-test fallout in contrib/postgres_fdw by updating
expected EXPLAIN output. With the planner change, the deparsed remote
SQL can omit a redundant constant there, so GROUP BY positional
references shift accordingly; query results are unchanged.

Behavior is unchanged from v1:
- Postpone additional non-sort target expressions only when doing so
does not require carrying any extra Vars/PlaceHolderVars through Sort.
- Existing volatile/SRF/expensive-expression behavior is unchanged.

Validation:
- make check-world passes.

Would especially appreciate feedback on whether the “no extra Vars/PHVs
through sort” rule is the right safety boundary.

Thanks!

--
Best regards,
Chengpeng Yan

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Do we still need MULE_INTERNAL?
Next
From: Jim Jones
Date:
Subject: Re: Add CREATE SCHEMA ... LIKE support