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>, pgsql-hackers(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
Subject: Re: Row pattern recognition
Date: 2026-06-24 02:33:24
Message-ID: CACJufxHJG_FWo2e+jyG9ynfE0+65eEWA_6qq1mEJO1z3G2V8Hg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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/

Attachment Content-Type Size
v50-0001-refactor-absorbability-helper-functions.nocfbot application/octet-stream 16.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2026-06-24 02:52:40 Re: Fix HAVING-to-WHERE pushdown with mismatched operator families
Previous Message Sungwoo Chang 2026-06-24 02:25:15 Re: Fwd: dsm_registry: Add detach and destroy features