Re: Row pattern recognition

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: assam258(at)gmail(dot)com
Cc: 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, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Row pattern recognition
Date: 2026-02-24 02:56:25
Message-ID: 20260224.115625.1966558814200895991.ishii@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Henson,

> Hi Tatsuo,
>
> Here are six incremental patches on top of v43.
>
> nocfbot-0001 through nocfbot-0004 are the same patches from the
> previous round (32-bit test fix, PREV/NEXT restriction, ALT lexical
> ordering, reluctant quantifiers).
>
> nocfbot-0005: Detect zero-consumption NFA cycles
>
> Adds a per-element visited bitmap to detect zero-consumption cycles
> during DFS epsilon expansion. Before each state's DFS, the bitmap
> is cleared; as nfa_advance_state() recurses through epsilon
> transitions, each elemIdx is marked visited. If the same elemIdx
> is reached again within the same DFS, it means an epsilon-only
> loop -- the state is freed immediately.
>
> The ad-hoc (count == 0 && min == 0) exit condition in
> nfa_advance_end() is removed. The FIXME test cases are resolved
> and renamed to "Zero-Consumption Cycle Detection".
>
> nocfbot-0006: Allow A{0} quantifier
>
> With cycle detection in place, this becomes straightforward.
> Lowers the {n} bound minimum from 1 to 0. A{0} is treated as an
> epsilon transition -- the variable is skipped entirely.

Great!

> Next I plan to work on test reorganization, cross-database result
> comparison, and a review pass over the NFA executor.

Looking forward to seeing next patches.

BTW, in create_windowagg_plan (createplan.c),
around:
/* Build RPR pattern and filter defineClause */

collectPatternVariables, filterDefineClause and buildRPRPattern are
called in a block without any if or any other conditional
statements. This is an unusual codiing style in PostgreSQL. I suggest
to fix this. Attached is a proposed patch for this.

Best regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

Attachment Content-Type Size
unknown_filename text/plain 2.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-02-24 03:00:23 Re: Improve OAuth discovery logging
Previous Message David Rowley 2026-02-24 02:23:17 Re: More speedups for tuple deformation