Re: Row pattern recognition - Mailing list pgsql-hackers

From jian he
Subject Re: Row pattern recognition
Date
Msg-id CACJufxHJG_FWo2e+jyG9ynfE0+65eEWA_6qq1mEJO1z3G2V8Hg@mail.gmail.com
Whole thread
In response to Re: Row pattern recognition  (Henson Choi <assam258@gmail.com>)
Responses Re: Row pattern recognition
Re: Row pattern recognition
List 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

pgsql-hackers by date:

Previous
From: Sungwoo Chang
Date:
Subject: Re: Fwd: dsm_registry: Add detach and destroy features
Next
From: Richard Guo
Date:
Subject: Re: Fix HAVING-to-WHERE pushdown with mismatched operator families