nocfbot-0015-Round-out-README.rpr-WindowAggState.txt

text/plain

Filename: nocfbot-0015-Round-out-README.rpr-WindowAggState.txt
Type: text/plain
Part: 3
Message: Re: Row pattern recognition
From ad5f8dc3b587b2aed17954b5bfcdea2a4c94c288 Mon Sep 17 00:00:00 2001
From: Henson Choi <assam258@gmail.com>
Date: Tue, 12 May 2026 15:43:49 +0900
Subject: [PATCH 15/15] Round out README.rpr WindowAggState field coverage

Follow-up to the previous commit applying Tatsuo Ishii's
review.  That commit added three WindowAggState fields to
V-3 but left a few related entries out, and Appendix B's
diagram still showed the pre-review field list.

- Add nfaVisitedMinWord and nfaVisitedMaxWord to V-3
- Note that EXPLAIN ANALYZE instrumentation counters are
  omitted from V-3 (see execnodes.h)
- Mirror the V-3 additions in the Appendix B diagram
---
 src/backend/executor/README.rpr | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/backend/executor/README.rpr b/src/backend/executor/README.rpr
index 6c2bddab455..6ff7f33e62e 100644
--- a/src/backend/executor/README.rpr
+++ b/src/backend/executor/README.rpr
@@ -522,10 +522,15 @@ V-3. RPR Fields of WindowAggState
   nfaVarMatched                 Per-row cache: varMatched[varId]
   nfaVisitedElems               Bitmap for cycle detection
   nfaVisitedNWords              Number of bitmapwords in nfaVisitedElems
+  nfaVisitedMinWord             Lowest bitmapword index touched since last reset
+  nfaVisitedMaxWord             Highest bitmapword index touched since last reset
   nfaStateSize                  Precomputed size of RPRNFAState
   defineMatchStartDependent     DEFINE vars needing per-context evaluation (match_start-dependent)
   nfaLastProcessedRow           Last row processed by NFA (-1 = none)
 
+  EXPLAIN ANALYZE instrumentation counters are omitted here; see
+  execnodes.h for the full list.
+
 Memory management:
 
   States and contexts are managed through their own free lists.
@@ -1480,7 +1485,13 @@ Appendix B. Data Structure Relationship Diagram
     |--- defineVariableList: List<String> (variable names, DEFINE order)
     |--- defineClauseList: List<ExprState>
     |--- nfaVarMatched: bool[] (per-row cache)
+    |--- defineMatchStartDependent: Bitmapset* (match_start-dependent
+    |        DEFINE vars; see VI-4)
     |--- nfaVisitedElems: bitmapword* (cycle detection)
+    |--- nfaVisitedNWords: int (size of nfaVisitedElems)
+    |--- nfaVisitedMinWord / nfaVisitedMaxWord: int16
+    |        (touched-word range for fast reset)
+    |--- nfaLastProcessedRow: int64 (-1 = none)
     |--- nfaStateSize: Size (pre-calculated RPRNFAState allocation size)
     |--- nfaContext <-> nfaContextTail (doubly-linked list)
     |   +--- RPRNFAContext
-- 
2.50.1 (Apple Git-155)