pgsql: Refactor ChangeVarNodesExtended() using the custom callback

Started by Alexander Korotkovabout 1 year ago5 messagescomitters
Jump to latest
#1Alexander Korotkov
aekorotkov@gmail.com

Refactor ChangeVarNodesExtended() using the custom callback

fc069a3a6319 implemented Self-Join Elimination (SJE) and put related logic
to ChangeVarNodes_walker(). This commit provides refactoring to remove the
SJE-related logic from ChangeVarNodes_walker() but adds a custom callback to
ChangeVarNodesExtended(), which has a chance to process a node before
ChangeVarNodes_walker(). Passing this callback to ChangeVarNodesExtended()
allows SJE-related node handling to be kept within the analyzejoins.c.

Reported-by: Richard Guo <guofenglinux@gmail.com>
Discussion: /messages/by-id/CAMbWs49PE3CvnV8vrQ0Dr=HqgZZmX0tdNbzVNJxqc8yg-8kDQQ@mail.gmail.com
Author: Andrei Lepikhov <lepihov@gmail.com>
Author: Alexander Korotkov <aekorotkov@gmail.com>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/250a718aadad68793e82103282247556a46a3cfc

Modified Files
--------------
src/backend/optimizer/plan/analyzejoins.c | 160 +++++++++++++++++++++++++++---
src/backend/rewrite/rewriteManip.c | 138 ++++++--------------------
src/include/rewrite/rewriteManip.h | 17 +++-
src/tools/pgindent/typedefs.list | 1 +
4 files changed, 192 insertions(+), 124 deletions(-)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alexander Korotkov (#1)
Re: pgsql: Refactor ChangeVarNodesExtended() using the custom callback

Alexander Korotkov <akorotkov@postgresql.org> writes:

Refactor ChangeVarNodesExtended() using the custom callback

You are aware that we are in release freeze, no?

regards, tom lane

#3Alexander Korotkov
aekorotkov@gmail.com
In reply to: Tom Lane (#2)
Re: pgsql: Refactor ChangeVarNodesExtended() using the custom callback

On Sat, May 3, 2025 at 10:34 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Alexander Korotkov <akorotkov@postgresql.org> writes:

Refactor ChangeVarNodesExtended() using the custom callback

You are aware that we are in release freeze, no?

I missed that. Should I revert this commit now?

------
Regards,
Alexander Korotkov
Supabase

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alexander Korotkov (#3)
Re: pgsql: Refactor ChangeVarNodesExtended() using the custom callback

Alexander Korotkov <aekorotkov@gmail.com> writes:

On Sat, May 3, 2025 at 10:34 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

You are aware that we are in release freeze, no?

I missed that. Should I revert this commit now?

Yes, I think so. If you feel it's critical enough to go in on a
release weekend, you should ask pgsql-release@ for an exception.

regards, tom lane

#5Alexander Korotkov
aekorotkov@gmail.com
In reply to: Tom Lane (#4)
Re: pgsql: Refactor ChangeVarNodesExtended() using the custom callback

On Sat, May 3, 2025 at 11:06 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Alexander Korotkov <aekorotkov@gmail.com> writes:

On Sat, May 3, 2025 at 10:34 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

You are aware that we are in release freeze, no?

I missed that. Should I revert this commit now?

Yes, I think so. If you feel it's critical enough to go in on a
release weekend, you should ask pgsql-release@ for an exception.

I don't think it's critical enough. Reverted.
My apologies for breaking the rules.

------
Regards,
Alexander Korotkov
Supabase