v50-0020-clarify-step-no_equal.patch
application/octet-stream
Filename: v50-0020-clarify-step-no_equal.patch
Type: application/octet-stream
Part: 28
Message:
Re: Row pattern recognition
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v50-0020
Subject: Clarify row pattern recognition comments on "step" and no_equal
| File | + | − |
|---|---|---|
| src/backend/optimizer/plan/rpr.c | 3 | 0 |
| src/include/nodes/plannodes.h | 4 | 3 |
From 59052a0beb3a7489b026dee2e812ae31db6858fb Mon Sep 17 00:00:00 2001
From: Henson Choi <assam258@gmail.com>
Date: Tue, 23 Jun 2026 21:39:36 +0900
Subject: [PATCH v50 29/29] Clarify row pattern recognition comments on "step"
and no_equal
Define "step" in isUnboundedStart()'s examples as the number of VARs in
one fully unrolled iteration of the group, and reword the RPRPattern
comment on why equal() support is suppressed: equal() routines are
generated only for parse/rewrite nodes, not plan nodes. Comment-only.
---
src/backend/optimizer/plan/rpr.c | 3 +++
src/include/nodes/plannodes.h | 7 ++++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/backend/optimizer/plan/rpr.c b/src/backend/optimizer/plan/rpr.c
index 1c59e8a70a0..fac3d7bcf38 100644
--- a/src/backend/optimizer/plan/rpr.c
+++ b/src/backend/optimizer/plan/rpr.c
@@ -1583,6 +1583,9 @@ isFixedLengthChildren(RPRPattern *pattern, RPRElemIdx idx, RPRDepth scopeDepth)
* This is equivalent to unrolling to {1,1} VARs, e.g., (A B B)+ C.
* All elements within the group get ABSORBABLE_BRANCH.
* Only the unbounded END gets ABSORBABLE (comparison point).
+ *
+ * In the examples below, "step" is the number of VARs in one fully
+ * unrolled iteration of the group (its fixed per-iteration length).
* Examples:
* (A B{2})+ C - B{2} has min==max, step=3
* (A (B C){2} D)+ E - nested {2} subgroup, step=6
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
index 7c4eacdf82d..2b37c8f226a 100644
--- a/src/include/nodes/plannodes.h
+++ b/src/include/nodes/plannodes.h
@@ -1284,9 +1284,10 @@ typedef struct RPRPattern
{
/*
* RPRPattern is a plan/exec-only node with arrays that need a
- * hand-written copy (custom_copy_equal), but it is never compared by
- * equal() -- it does not appear in parse/rewrite trees, and equal() has
- * no Plan-node routines -- so equal support is suppressed with no_equal.
+ * hand-written copy (custom_copy_equal). It is never compared with
+ * equal(): equal() routines are generated only for parse/rewrite-level
+ * nodes, not for plan nodes, so there is nothing to compare it against
+ * and equal support is suppressed with no_equal.
*/
pg_node_attr(custom_copy_equal, custom_read_write, no_equal)
--
2.50.1 (Apple Git-155)