Re: Row pattern recognition

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: assam258(at)gmail(dot)com
Cc: Tatsuo Ishii <ishii(at)postgresql(dot)org>, zsolt(dot)parragi(at)percona(dot)com, sjjang112233(at)gmail(dot)com, vik(at)postgresfriends(dot)org, er(at)xs4all(dot)nl, jacob(dot)champion(at)enterprisedb(dot)com, david(dot)g(dot)johnston(at)gmail(dot)com, peter(at)eisentraut(dot)org, li(dot)evan(dot)chao(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Row pattern recognition
Date: 2026-10-17 02:38:00
Message-ID: CACJufxEZ0c+rUcoraRYcjySB_2ArQ_yADxFmV2V=3js0NBPZRQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 14, 2026 at 8:35 AM Henson Choi <assam258(at)gmail(dot)com> wrote:
>
> 0003 Remove WindowAggState.nfaStateSize
>
> > I always want to get rid of WindowAggState.nfaStateSize. It's ugly.
>
> I would like to keep that field. The size depends only on the
> pattern, so it is computed once, and I do not want to repeat the
> same computation on a path this frequent just to save a field. To
> me the field is the cleaner choice.
>
Hi.

Let's agree to disagree, at least now, removing
WindowAggState.nfaStateSize is not performance related.
Also as mentioned in
https://www.postgresql.org/message-id/688312.1782222788%40sss.pgh.pa.us
we should use size_t, not using Size

Please check attached 0001 and 0002.

0001: Remove RPRNavExpr.navno
navno spans all three stages: ParseRPRNavCall() initializes it,
compute_define_metadata() compute it while planning, and ExecInitExprRec() use
it. Tracking and keeping those in sync is not trivial.
It's doable to just remove it.

0002: Remove compute_define_metadata
IMHO compute_define_metadata() is complicated.
Instead, loop over the DEFINE clause with foreach, run an expression walker
on each variable's expression to check whether it depends on the match
start, and if it does, record that variable's index.

--
jian
https://www.enterprisedb.com/

Attachment Content-Type Size
v54-0001-Remove-RPRNavExpr.navno.txt text/plain 24.9 KB
v54-0002-Remove-compute_define_metadata.txt text/plain 9.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message C W 2026-10-17 03:11:15 Re: Fix doc: explanation of how postgres works when OOM killer is invoked
Previous Message Takeshi Ideriha 2026-10-17 02:08:19 Re: Fix doc: explanation of how postgres works when OOM killer is invoked