public inbox for [email protected]  
help / color / mirror / Atom feed
From: Henson Choi <[email protected]>
To: Tatsuo Ishii <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Subject: Re: Row pattern recognition
Date: Thu, 5 Feb 2026 09:46:06 +0900
Message-ID: <CAAAe_zA=BDm=e04aNFYe3Az0CzPipK+HHzu1KGHiLOg+r_z8XQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAAAe_zDtstKUcKsH3FJuKeZ=ykXFWKO1Lz80JXEn9y8BeQeYNQ@mail.gmail.com>
	<[email protected]>
	<CAAAe_zC95wT9EdBu_nBn6mWVB7-xNNuJ4N8wPr0LrWJBdwmxiQ@mail.gmail.com>
	<[email protected]>

Hi Tatsuo,

> Therefore, I believe it only makes sense to add explicit initialization
> > for nfaStatesActive and nfaContextsActive, since these are the only two
> > that release_partition() also explicitly resets.
>
> That makes sense.
>

Thank you for confirming.

> ## Proposal for consistency
> >
> >   /* Initialize NFA free lists for row pattern matching */
> >   winstate->nfaContext = NULL;
> >   winstate->nfaContextTail = NULL;
> >   winstate->nfaContextFree = NULL;
> >   winstate->nfaStateFree = NULL;
> >   winstate->nfaLastProcessedRow = -1;
> >   winstate->nfaStatesActive = 0;        // Add this
> >   winstate->nfaContextsActive = 0;      // Add this
> >
> > Would you like me to include this change in the next patch?
>
> Yes, please.
>


Done. Please see the attached patch.

Best regards,
Henson

From d06525db781c3432d488706759c653d00a5e1980 Mon Sep 17 00:00:00 2001
From: Henson Choi <[email protected]>
Date: Thu, 5 Feb 2026 09:41:03 +0900
Subject: [PATCH] Initialize NFA per-partition counters in ExecInitWindowAgg

---
 src/backend/executor/nodeWindowAgg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c
index 1176df04b2c..1e088615d19 100644
--- a/src/backend/executor/nodeWindowAgg.c
+++ b/src/backend/executor/nodeWindowAgg.c
@@ -3054,6 +3054,8 @@ ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags)
 	winstate->nfaContextFree = NULL;
 	winstate->nfaStateFree = NULL;
 	winstate->nfaLastProcessedRow = -1;
+	winstate->nfaStatesActive = 0;
+	winstate->nfaContextsActive = 0;
 
 	/*
 	 * Allocate varMatched array for NFA evaluation. With the new varNames
-- 
2.50.1 (Apple Git-155)



Attachments:

  [text/plain] nfa_init_consistency.txt (887B, 3-nfa_init_consistency.txt)
  download | inline diff:
From d06525db781c3432d488706759c653d00a5e1980 Mon Sep 17 00:00:00 2001
From: Henson Choi <[email protected]>
Date: Thu, 5 Feb 2026 09:41:03 +0900
Subject: [PATCH] Initialize NFA per-partition counters in ExecInitWindowAgg

---
 src/backend/executor/nodeWindowAgg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c
index 1176df04b2c..1e088615d19 100644
--- a/src/backend/executor/nodeWindowAgg.c
+++ b/src/backend/executor/nodeWindowAgg.c
@@ -3054,6 +3054,8 @@ ExecInitWindowAgg(WindowAgg *node, EState *estate, int eflags)
 	winstate->nfaContextFree = NULL;
 	winstate->nfaStateFree = NULL;
 	winstate->nfaLastProcessedRow = -1;
+	winstate->nfaStatesActive = 0;
+	winstate->nfaContextsActive = 0;
 
 	/*
 	 * Allocate varMatched array for NFA evaluation. With the new varNames
-- 
2.50.1 (Apple Git-155)



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Row pattern recognition
  In-Reply-To: <CAAAe_zA=BDm=e04aNFYe3Az0CzPipK+HHzu1KGHiLOg+r_z8XQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox