Re: A modest proposal: make parser/rewriter/planner inputs read-only

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: A modest proposal: make parser/rewriter/planner inputs read-only
Дата
Msg-id 1915837.1744820562@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: A modest proposal: make parser/rewriter/planner inputs read-only  (Andrei Lepikhov <lepihov@gmail.com>)
Ответы Re: A modest proposal: make parser/rewriter/planner inputs read-only
Список pgsql-hackers
Andrei Lepikhov <lepihov@gmail.com> writes:
> I just want to understand how your idea will work. The query_planner 
> does the job for subqueries separately. If a query is transformed in 
> some way (let's say, an unnecessary join is deleted), we need to change 
> references in the parse tree of another subquery, or it will not find 
> the reference at the moment of planning, right?

Don't see why.  If we're separately planning a subquery, we would
not dare to change anything about its outputs, just as we would
not make a change that affects the topmost level's outputs.  I don't
believe there's anything right now that requires a recursive
subquery_planner call to change the outer parsetree, and this idea
wouldn't affect that.

Now, subquery_planner does have side effects on the PlannerGlobal
struct, but that's planner-local data, not an input to the planner.

Maybe we would like to have some enforced contract about what
subquery_planner can and can't touch in the outer planner level's
data, but I'm not feeling a great need for that right now.

            regards, tom lane



В списке pgsql-hackers по дате отправления: