summaryrefslogtreecommitdiff
path: root/src/backend/optimizer
diff options
context:
space:
mode:
authorRichard Guo <rguo@postgresql.org>2025-11-05 12:29:31 +0900
committerRichard Guo <rguo@postgresql.org>2025-11-05 12:29:31 +0900
commit59dec6c0b09f717e4ce78d54f578d56ef93bcc53 (patch)
treec56a337300c154078fdb791e102716c3c5fbefbc /src/backend/optimizer
parent2fc31079624e16d6b1a8508958dbf81e8edce057 (diff)
Fix comments for ChangeVarNodes() and related functions
The comment for ChangeVarNodes() refers to a parameter named change_RangeTblRef, which does not exist in the code. The comment for ChangeVarNodesExtended() contains an extra space, while the comment for replace_relid_callback() has an awkward line break and a typo. This patch fixes these issues and revises some sentences for smoother wording. Oversights in commits ab42d643c and fc069a3a6. Author: Richard Guo <guofenglinux@gmail.com> Discussion: https://postgr.es/m/CAMbWs480j16HC1JtjKCgj5WshivT8ZJYkOfTyZAM0POjFomJkg@mail.gmail.com Backpatch-through: 18
Diffstat (limited to 'src/backend/optimizer')
-rw-r--r--src/backend/optimizer/plan/analyzejoins.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/optimizer/plan/analyzejoins.c b/src/backend/optimizer/plan/analyzejoins.c
index 6a3c030e8ef..e592e1ac3d1 100644
--- a/src/backend/optimizer/plan/analyzejoins.c
+++ b/src/backend/optimizer/plan/analyzejoins.c
@@ -1683,14 +1683,14 @@ add_non_redundant_clauses(PlannerInfo *root,
}
/*
- * A custom callback for ChangeVarNodesExtended() providing
- * Self-join elimination (SJE) related functionality
+ * A custom callback for ChangeVarNodesExtended() providing Self-join
+ * elimination (SJE) related functionality
*
- * SJE needs to skip the RangeTblRef node
- * type. During SJE's last step, remove_rel_from_joinlist() removes
- * remaining RangeTblRefs with target relid. If ChangeVarNodes() replaces
- * the target relid before, remove_rel_from_joinlist() fails to identify
- * the nodes to delete.
+ * SJE needs to skip the RangeTblRef node type. During SJE's last
+ * step, remove_rel_from_joinlist() removes remaining RangeTblRefs
+ * with target relid. If ChangeVarNodes() replaces the target relid
+ * before, remove_rel_from_joinlist() would fail to identify the nodes
+ * to delete.
*
* SJE also needs to change the relids within RestrictInfo's.
*/
@@ -1769,8 +1769,8 @@ replace_relid_callback(Node *node, ChangeVarNodes_context *context)
/*
* For self-join elimination, changing varnos could transform
* "t1.a = t2.a" into "t1.a = t1.a". That is always true as long
- * as "t1.a" is not null. We use qual() to check for such a case,
- * and then we replace the qual for a check for not null
+ * as "t1.a" is not null. We use equal() to check for such a
+ * case, and then we replace the qual with a check for not null
* (NullTest).
*/
if (leftOp != NULL && equal(leftOp, rightOp))