Re: why memoize is not used for correlated subquery

2024-05-28 Thread Andy Fan
> I imagined making this work by delaying the plan creation for > subqueries until the same time as create_plan() for the outer query. Do you mean sublinks rather than subqueries? if so, we can get another benefit I want very much. explain (costs off) select * from t1 where t1.a = 1

Re: why memoize is not used for correlated subquery

2024-05-28 Thread Pavel Stehule
út 28. 5. 2024 v 9:48 odesílatel David Rowley napsal: > On Tue, 28 May 2024 at 19:31, Pavel Stehule > wrote: > > My question is - does memoize support subqueries? And can be enhanced to > support this exercise without LATERAL and optimization fences? > > It's only currently considered for parame

Re: why memoize is not used for correlated subquery

2024-05-28 Thread David Rowley
On Tue, 28 May 2024 at 19:31, Pavel Stehule wrote: > My question is - does memoize support subqueries? And can be enhanced to > support this exercise without LATERAL and optimization fences? It's only currently considered for parameterized nested loop joins, not for subplans. I wrote a bit abou

Re: why memoize is not used for correlated subquery

2024-05-28 Thread Tender Wang
Pavel Stehule 于2024年5月28日周二 15:31写道: > Hi > > > My question is - does memoize support subqueries? And can be enhanced to > support this exercise without LATERAL and optimization fences? > > The commit messages in memoize may answer your question: "For now, the planner will only consider using

why memoize is not used for correlated subquery

2024-05-28 Thread Pavel Stehule
Hi I am playing with examples for P2D2, and I found few issues related to memoize 1. I use dataset https://pgsql.cz/files/obce.sql - it is data about czech population Dictionary - "obec" -> "village", "pocet_muzu" -> "number_of_men", "pocet_zen" -> "number_of_woman", "okres" -> "district", "naze