Re: Row pattern recognition

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: assam258@gmail.com
Cc: Tatsuo Ishii <ishii@postgresql.org>, pgsql-hackers@postgresql.org, zsolt.parragi@percona.com, sjjang112233@gmail.com, vik@postgresfriends.org, er@xs4all.nl, jacob.champion@enterprisedb.com, david.g.johnston@gmail.com, peter@eisentraut.org, li.evan.chao@gmail.com
Date: 2026-06-24T02:33:24Z
Lists: pgsql-hackers

Attachments

Hi.

The attached patch refactors absorbability helper functions, white at
it, also other misc changes.
It's still based on https://github.com/assam258-5892/postgres/commits/RPR

The below is commit message:
----------------------------------------------------------------------------
Rename isUnboundedStart() to start_with_unbounded_quantifier() and
isFixedLengthChildren() to isFixedQuantifier() for clarity.

Rework start_with_unbounded_quantifier() to accept an RPRPatternElement *
directly instead of an index, and restructure its body as an explicit
if/else chain over element kinds (VAR, BEGIN, ALT/FIN, END) rather than
two loosely-coupled early-return checks.

Fix subgroup traversal in isFixedQuantifier() to use elem->jump - 1 to
locate the matching END element directly, replacing the previous loop
that walked next pointers.

Move isAbsorbable initialization from finalizeRPRPattern() into
makeRPRPattern(), and guard the computeAbsorbabilityRecursive() call in
computeAbsorbability() so it is only entered when the first element is
an ALT or has an unbounded quantifier.

Use palloc_array/palloc0_array in makeRPRPattern(). Remove the redundant
"T_RPRPattern" comment on the NodeTag field. Update README.rpr and
in-code comments to reflect the new function names.
----------------------------------------------------------------------------



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

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Adjust cross-version upgrade tests for seg_out() fix

  2. Rationalize error comments in partition split/merge tests

  3. Add fast path for foreign key constraint checks

  4. Fix assorted pretty-trivial memory leaks in the backend.

  5. Add temporal FOREIGN KEY contraints

  6. Add trailing commas to enum definitions

  7. Remove obsolete executor cleanup code