Re: Avoid unnecessary wrapping for more complex expressions

2024-12-17 Thread Richard Guo
On Wed, Dec 11, 2024 at 4:31 PM Richard Guo wrote: > As mentioned in that thread, I feel that we can apply a similar > optimization to more complex non-var expressions: if a strict > expression contains any variables of rels that are under the same > lowest nulling outer join as the subquery, we c

Avoid unnecessary wrapping for more complex expressions

2024-12-10 Thread Richard Guo
In commit f64ec81a8 we introduced an optimization that avoids wrapping for Vars and PHVs if they are lateral references to something outside the subquery, and the referenced rel is under the same lowest nulling outer join. It could be beneficial to get rid of such PHVs because they imply lateral d