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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrei Lepikhov <lepihov(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: A modest proposal: make parser/rewriter/planner inputs read-only
Date: 2025-04-15 17:34:55
Message-ID: 1705756.1744738495@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrei Lepikhov <lepihov(at)gmail(dot)com> writes:
> But what is the way you are proposing here? Do you mean that one more
> entity will be explicitly introduced: a transformed parse tree?

No, I wasn't thinking of adding new concepts, just saying that the
inputs to certain operations need to be treated as read-only.
What would you envision a "transformed parse tree" being that's not
what we have today?

> It would open an opportunity for extensions to build a set of
> alternative transformed trees, pass them through the optimisation phase
> and choose the best plan.

Yeah, the ability to repeatedly operate on a tree without the overhead
of making copies would be a major benefit of being stricter here.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-04-15 17:53:07 Re: [PoC] Federated Authn/z with OAUTHBEARER
Previous Message Tom Lane 2025-04-15 17:31:44 Re: A modest proposal: make parser/rewriter/planner inputs read-only