| From: | Henson Choi <assam258(at)gmail(dot)com> |
|---|---|
| To: | Tatsuo Ishii <ishii(at)postgresql(dot)org> |
| Cc: | 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, jian he <jian(dot)universality(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Row pattern recognition |
| Date: | 2026-05-09 07:43:18 |
| Message-ID: | CAAAe_zCL9UtiYthrSaXCmhFMK6Q3YQ6BQGgae7C9en2k=S9doA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Tatsuo,
Eleven incremental patches on top of v47. Patches 0001-0010
are the same set I posted on 2026-05-07, with cosmetic touches
only. Patch 0011 is new and tightens the consistency of how
this code base cites the SQL standard.
So far I have been pushing ahead narrowly on the feature
implementation itself. I am aware I still have much to learn
about the PostgreSQL project's culture and conventions, and
your continued guidance would be very much appreciated.
Patch summary:
- 0001 Add DEFINE non-volatile baseline to rpr_integration B9
Adds a STABLE/IMMUTABLE baseline ahead of the volatile
case so the rejection in 0002 is visible against a working
reference.
- 0002 Unify RPR DEFINE walkers and reject volatile callees
[A]. Collapses the four DEFINE walkers (parser / planner
/ executor) into one phase-tagged traversal and, on that
base, rejects volatile / NextValueExpr at parse-analysis.
STABLE / IMMUTABLE accepted. The offset runtime-constant
check is folded in; B9 flips to error-case and its XXX is
dropped.
- 0003 Cover RPR empty-match path with EXPLAIN tests; fix
stale XXX comments
[B]. Adds rpr_explain coverage that surfaces "NFA: N
matched (len 0/0/0.0)" so the NFA-found-but-empty-frame
path is regression-visible; replaces stale rpr_nfa XXXs.
- 0004 Reclassify DEFINE qualifier check and reword
diagnostic to "expression"
[D]. Tri-classifies (pattern var / range var / fall-
through) so unknown qualifiers fall through to the
standard "column does not exist" diagnostic. Reworded to
"expression" since the quoted token may include
indirection on composite types (e.g. (A.items).amount).
- 0005 Sync stale comments on DEFINE/PATTERN handling
validateRPRPatternVarCount() rejects DEFINE names not in
PATTERN, but comments / SELECT doc described it as
"collection" / "filtered during planning". Wording
aligned; XXX note's "column references" bumped to
"expressions" to match 0004. Comment + doc only.
- 0006 Add trailing commas to RPR enum definitions
Per Jian. RPRNavKind, RPRNavOffsetKind, RPRPatternNodeType.
- 0007 Remove optional outer parentheses from ereport() calls
in RPR files
Per Jian + your gram.y patch. 19 sites in parse_rpr.c /
optimizer/plan/rpr.c plus the gram.y sites.
- 0008 Add high-water mark tracking to NFA visited bitmap
reset
[C]. Resets only the touched span (O(span_words) instead
of O(numElements/64)), at the cost of two int16 comparisons
per visit. Semantics unchanged; happy to drop if you
prefer the simpler bulk reset.
- 0009 Document DEFINE subquery rejection as intentional
over-rejection
Comment-only. Records that SQL/RPR permits a non-RPR,
non-pattern-var-correlated subquery in DEFINE (see 0011
for the normalized citation), and that our blanket
rejection is deliberate over-rejection. The case
distinction (walk subquery Query for nested RPR; match
ColumnRef qualifiers against ancestor p_rpr_pattern_vars)
is doable with existing infrastructure and left as future
work, not blocked on any other feature.
- 0010 Remove duplicate #include in nodeWindowAgg.c
"common/int.h" was included twice and the first occurrence
was misplaced between catalog/* headers. Drops the
misplaced first; the second sits at the correct
alphabetical position.
- 0011 Normalize SQL/RPR standard references across code,
comments, and tests
Doc/comment/test-header hygiene. Standardizes citations
to ISO/IEC 19075-5 (SQL Technical Report Part 5, "Row
pattern recognition in SQL"); earlier comments mixed bare
"19075-5", "9075-2", "SQL standard", and "SQL:2016 STR06"
forms. Where Chapter 4 (FROM / R010) and Chapter 6
(WINDOW / R020) describe parallel material, cites the
Chapter 6 subclause first since this implementation
targets R020. Pins "STR06" to its source (Subclause
7.2.8) in the rpr_nfa / rpr_explain commentary; replaces
ad-hoc section / arrow glyphs with ASCII. Adds a short
normative-reference paragraph to executor/README.rpr so
future patches inherit the policy. Comments / docs /
test headers only.
Still deferred:
- B7 Recursive CTE XXX: pending community input on the
ISO/IEC 19075-5 6.17.5 / 4.18.5 interpretation.
Best regards,
Henson
| Attachment | Content-Type | Size |
|---|---|---|
| nocfbot-0001-DEFINE-non-volatile-baseline.txt | text/plain | 3.2 KB |
| nocfbot-0002-Unify-DEFINE-walkers-reject-volatile.txt | text/plain | 69.1 KB |
| nocfbot-0003-Empty-match-EXPLAIN-coverage.txt | text/plain | 19.0 KB |
| nocfbot-0004-Reclassify-DEFINE-qualifier-check.txt | text/plain | 11.9 KB |
| nocfbot-0005-Sync-DEFINE-PATTERN-comments.txt | text/plain | 4.4 KB |
| nocfbot-0006-Trailing-commas-RPR-enums.txt | text/plain | 1.8 KB |
| nocfbot-0007-ereport-outer-parens.txt | text/plain | 18.8 KB |
| nocfbot-0008-NFA-visited-high-water-mark.txt | text/plain | 5.0 KB |
| nocfbot-0009-Document-DEFINE-subquery-rejection.txt | text/plain | 2.6 KB |
| nocfbot-0010-Remove-duplicate-include-nodeWindowAgg.txt | text/plain | 1.1 KB |
| nocfbot-0011-Normalize-RPR-standard-refs.txt | text/plain | 13.6 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | lakshmi | 2026-05-09 08:02:44 | Re: parallel data loading for pgbench -i |
| Previous Message | Junwang Zhao | 2026-05-09 07:25:03 | [SQL/PGQ] Early pruning for GRAPH_TABLE path generation |