From 21d452a6f97eed4c1c02a99fc8e040795612a2b7 Mon Sep 17 00:00:00 2001 From: Henson Choi Date: Thu, 12 Nov 2026 15:03:38 +0900 Subject: [PATCH 1/6] Update rpr_explain expected output for Function Scan storage in EXPLAIN --- src/test/regress/expected/rpr_explain.out | 382 +++++++++++++++------- 1 file changed, 258 insertions(+), 124 deletions(-) diff --git a/src/test/regress/expected/rpr_explain.out b/src/test/regress/expected/rpr_explain.out index e77fcef25bb..557a8f2b969 100644 --- a/src/test/regress/expected/rpr_explain.out +++ b/src/test/regress/expected/rpr_explain.out @@ -263,7 +263,8 @@ WINDOW w AS ( NFA: 7 matched (len 2/2/2.0), 0 mismatched NFA: 0 absorbed, 7 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Sequential alternations at the same depth -- Verifies that "((B | C) (D | E))*" correctly outputs as "((b | c) (d | e))*" @@ -300,7 +301,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 31 total, 24 pruned NFA: 6 matched (len 1/1/1.0), 0 mismatched -> Function Scan on generate_series s (actual rows=30.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- ALT branch whose tail is a group -- (A | (B C)+ (D E)+) means A | ((B C)+ (D E)+) by precedence, so the two @@ -341,7 +343,8 @@ WINDOW w AS ( NFA: 10 matched (len 1/4/2.5), 0 mismatched NFA: 0 absorbed, 5 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=30.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Quoted identifiers in EXPLAIN pattern deparse -- Mixed case names must be quoted to preserve round-trip safety @@ -402,7 +405,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 51 total, 25 pruned NFA: 25 matched (len 1/1/1.0), 0 mismatched -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Alternation pattern - multiple state branches CREATE VIEW rpr_ev_state_alt AS @@ -490,7 +494,8 @@ WINDOW w AS ( NFA: 33 matched (len 3/3/3.0), 0 mismatched NFA: 0 absorbed, 33 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Grouped pattern with quantifier - state count with grouping CREATE VIEW rpr_ev_state_group_quant AS @@ -529,7 +534,8 @@ WINDOW w AS ( NFA: 1 matched (len 60/60/60.0), 0 mismatched NFA: 29 absorbed (len 2/2/2.0), 30 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=60.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- State explosion pattern - many alternations CREATE VIEW rpr_ev_state_explosion AS @@ -568,7 +574,8 @@ WINDOW w AS ( NFA: 12 matched (len 8/8/8.0), 3 mismatched (len 2/4/3.0) NFA: 0 absorbed, 84 skipped (len 1/7/4.0) -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Consecutive ALT merge followed by different ALT -- ((A | B) (A | B) (C | D)) -> (A|B){2} (C|D) @@ -608,7 +615,8 @@ WINDOW w AS ( NFA: 9 matched (len 3/3/3.0), 1 mismatched (len 2/2/2.0) NFA: 0 absorbed, 18 skipped (len 1/2/1.5) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Consecutive ALT merge followed by non-ALT element -- ((A | B) (A | B) C) -> (A|B){2} C @@ -648,7 +656,8 @@ WINDOW w AS ( NFA: 12 matched (len 3/3/3.0), 2 mismatched (len 2/2/2.0) NFA: 0 absorbed, 24 skipped (len 1/2/1.5) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ALT prefix/suffix absorbed into GROUP: (A|B) (A|B)+ (A|B) -> (A|B){3,} CREATE VIEW rpr_ev_state_alt_absorb_group AS @@ -687,7 +696,8 @@ WINDOW w AS ( NFA: 1 matched (len 40/40/40.0), 0 mismatched NFA: 0 absorbed, 39 skipped (len 1/2/1.0) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Folding a copy that sits between two GROUPs leaves those GROUPs -- adjacent, which nothing had put side by side before, so the GROUP @@ -715,7 +725,8 @@ WINDOW w AS ( NFA: 1 matched (len 40/40/40.0), 0 mismatched NFA: 19 absorbed (len 2/2/2.0), 17 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- A leading copy reaches the fold as a prefix instead -- A B (A B)+ A B (A B)+ -> (A B){4,} @@ -740,7 +751,8 @@ WINDOW w AS ( NFA: 1 matched (len 40/40/40.0), 0 mismatched NFA: 19 absorbed (len 2/2/2.0), 17 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- The same with bounded quantifiers -- (A B){2} A B (A B){2} -> (A B){5} @@ -765,7 +777,8 @@ WINDOW w AS ( NFA: 4 matched (len 10/10/10.0), 0 mismatched NFA: 0 absorbed, 20 skipped (len 1/8/4.2) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Three GROUPs and two copies between them -- (A B)+ A B (A B)+ A B (A B)+ -> (A B){5,} @@ -790,7 +803,8 @@ WINDOW w AS ( NFA: 1 matched (len 40/40/40.0), 0 mismatched NFA: 19 absorbed (len 2/2/2.0), 16 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- High state count - alternation with plus quantifier CREATE VIEW rpr_ev_state_alt_plus AS @@ -829,7 +843,8 @@ WINDOW w AS ( NFA: 25 matched (len 4/4/4.0), 0 mismatched NFA: 0 absorbed, 75 skipped (len 1/3/2.0) -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Early termination: first ALT branch (A) reaches FIN immediately, -- pruning second branch (A B) before it can consume B. @@ -868,7 +883,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 101 total, 99 pruned NFA: 1 matched (len 1/1/1.0), 0 mismatched -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Nested quantifiers causing state growth CREATE VIEW rpr_ev_state_nested_quant AS @@ -907,7 +923,8 @@ WINDOW w AS ( NFA: 334 matched (len 1/2/2.0), 0 mismatched NFA: 0 absorbed, 333 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=1000.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- (A{2,})* must NOT flatten to a*: counts {0} UNION [2, INF) leave 1 -- unreachable. The planner keeps it as (a{2,})*, not a*. @@ -947,7 +964,8 @@ WINDOW w AS ( NFA: 4 matched (len 0/2/1.0), 0 mismatched NFA: 0 absorbed, 2 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=6.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Overlapping DEFINEs let two branches reach the same state, so this is the -- only case here with a nonzero merged count; the alt_merge names above mean @@ -988,7 +1006,8 @@ WINDOW w AS ( NFA: 6 matched (len 3/3/3.0), 8 mismatched (len 2/2/2.0) NFA: 0 absorbed, 12 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- Context Statistics Tests (peak, total, pruned + absorbed/skipped) @@ -1030,7 +1049,8 @@ WINDOW w AS ( NFA: 10 matched (len 5/5/5.0), 0 mismatched NFA: 30 absorbed (len 1/1/1.0), 10 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Bare unbounded quantifier: A+ absorbs redundant contexts -- min=1 commits no match until the run ends, @@ -1071,7 +1091,8 @@ WINDOW w AS ( NFA: 1 matched (len 10/10/10.0), 0 mismatched NFA: 9 absorbed (len 1/1/1.0), 0 skipped -> Function Scan on generate_series s (actual rows=10.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Bare min=0 quantifier: A* is skipped, not absorbed -- min=0 commits an empty match at creation, @@ -1112,7 +1133,8 @@ WINDOW w AS ( NFA: 1 matched (len 10/10/10.0), 0 mismatched NFA: 0 absorbed, 9 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=10.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- No absorption - bounded quantifier CREATE VIEW rpr_ev_ctx_no_absorb AS @@ -1151,7 +1173,8 @@ WINDOW w AS ( NFA: 10 matched (len 5/5/5.0), 0 mismatched NFA: 0 absorbed, 40 skipped (len 1/4/2.5) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Contexts skipped by SKIP PAST LAST ROW CREATE VIEW rpr_ev_ctx_skip AS @@ -1190,7 +1213,8 @@ WINDOW w AS ( NFA: 10 matched (len 3/3/3.0), 0 mismatched NFA: 0 absorbed, 10 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Unbounded group followed by a trailing element CREATE VIEW rpr_ev_ctx_absorb_group AS @@ -1229,7 +1253,8 @@ WINDOW w AS ( NFA: 33 matched (len 3/3/3.0), 0 mismatched NFA: 0 absorbed, 33 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Fixed-length group absorption: (A B B)+ C -- B B merged to B{2}; absorbable with fixed-length check @@ -1270,7 +1295,8 @@ WINDOW w AS ( NFA: 10 matched (len 7/7/7.0), 0 mismatched NFA: 10 absorbed (len 3/3/3.0), 10 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=70.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Nested fixed-length group absorption: (A (B C){2} D)+ E -- step_size = 1 + (1+1)*2 + 1 = 6; v % 13 cycle gives 2 iterations + E @@ -1314,7 +1340,8 @@ WINDOW w AS ( NFA: 5 matched (len 13/13/13.0), 0 mismatched NFA: 5 absorbed (len 6/6/6.0), 5 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=65.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Doubly nested fixed-length group absorption: (A ((B C{3}){2} D){2} E)+ F -- step_size = 1 + ((1+3)*2+1)*2 + 1 = 20; v % 41 cycle gives 2 iterations + F @@ -1366,7 +1393,8 @@ WINDOW w AS ( NFA: 2 matched (len 41/41/41.0), 0 mismatched NFA: 2 absorbed (len 20/20/20.0), 2 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=82.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- 3-level END chain absorption: ((A (B C){2}){2})+ -- step_size = (1 + (1+1)*2) * 2 = 10; v % 21 cycle gives 2 iterations @@ -1411,7 +1439,8 @@ WINDOW w AS ( NFA: 2 matched (len 20/20/20.0), 0 mismatched NFA: 2 absorbed (len 10/10/10.0), 8 skipped (len 1/5/3.0) -> Function Scan on generate_series s (actual rows=42.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- No absorption when DEFINE uses FIRST (match_start-dependent) -- Same pattern as rpr_ev_ctx_absorb_unbounded but with FIRST in DEFINE. @@ -1453,7 +1482,8 @@ WINDOW w AS ( NFA: 10 matched (len 5/5/5.0), 0 mismatched NFA: 0 absorbed, 40 skipped (len 1/4/2.5) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(10 rows) + Storage: Memory Maximum Storage: NkB +(11 rows) -- Absorption preserved when DEFINE uses only LAST without offset -- LAST(v) is match_start-independent (always currentpos), so absorption @@ -1496,7 +1526,8 @@ WINDOW w AS ( NFA: 10 matched (len 5/5/5.0), 0 mismatched NFA: 30 absorbed (len 1/1/1.0), 10 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(10 rows) + Storage: Memory Maximum Storage: NkB +(11 rows) -- No absorption with compound PREV(FIRST()) (match_start-dependent) CREATE VIEW rpr_ev_ctx_no_absorb_compound AS @@ -1530,7 +1561,8 @@ WINDOW w AS ( NFA: 10 matched (len 4/5/4.9), 1 mismatched (len 5/5/5.0) NFA: 0 absorbed, 39 skipped (len 1/4/2.5) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(10 rows) + Storage: Memory Maximum Storage: NkB +(11 rows) -- Variable-length group body absorption: (A+ B)+ C -- Body is not fixed-length, so the leading A+ is the comparison point @@ -1571,7 +1603,8 @@ WINDOW w AS ( NFA: 5 matched (len 10/10/10.0), 0 mismatched NFA: 35 absorbed (len 1/1/1.0), 5 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- No absorption when the enclosing group is reluctant: (A+ B)+? C -- Same body, DEFINE and rows as above; only the group quantifier differs. @@ -1612,7 +1645,8 @@ WINDOW w AS ( NFA: 5 matched (len 10/10/10.0), 0 mismatched NFA: 0 absorbed, 40 skipped (len 1/9/5.4) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- A fixed count leaves reluctance nothing to decide, so (A+ B){2}? is -- normalized to (A+ B){2} and absorbs where the unbounded (A+ B)+? above @@ -1654,7 +1688,8 @@ WINDOW w AS ( NFA: 5 matched (len 10/10/10.0), 0 mismatched NFA: 30 absorbed (len 1/1/1.0), 10 skipped (len 1/5/3.0) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) CREATE VIEW rpr_ev_ctx_absorb_fixed_reluctant AS SELECT count(*) OVER w @@ -1692,7 +1727,8 @@ WINDOW w AS ( NFA: 5 matched (len 10/10/10.0), 0 mismatched NFA: 30 absorbed (len 1/1/1.0), 10 skipped (len 1/5/3.0) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Alternation, non-absorbable branch match survives absorption: A+ B | C -- The dominating A+ run absorbs redundant contexts, but the recorded C matches @@ -1883,7 +1919,8 @@ WINDOW w AS ( NFA: 10 matched (len 10/10/10.0), 0 mismatched NFA: 80 absorbed (len 1/1/1.0), 10 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Very long matches CREATE VIEW rpr_ev_mlen_long AS @@ -1922,7 +1959,8 @@ WINDOW w AS ( NFA: 1 matched (len 196/196/196.0), 0 mismatched NFA: 194 absorbed (len 1/1/1.0), 1 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=200.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Uniform match length with mismatches from gap rows (v%20 = 11..15) CREATE VIEW rpr_ev_mlen_with_mismatch AS @@ -1965,7 +2003,8 @@ WINDOW w AS ( NFA: 5 matched (len 5/5/5.0), 5 mismatched (len 11/11/11.0) NFA: 60 absorbed (len 1/1/1.0), 5 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- Mismatch Length Statistics Tests @@ -2022,7 +2061,8 @@ WINDOW w AS ( NFA: 10 matched (len 6/6/6.0), 0 mismatched NFA: 20 absorbed (len 1/1/1.0), 10 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Long partial matches that fail CREATE VIEW rpr_ev_mlen_long_partial AS @@ -2085,7 +2125,8 @@ WINDOW w AS ( NFA: 1 matched (len 30/30/30.0), 1 mismatched (len 26/26/26.0) NFA: 42 absorbed (len 1/1/1.0), 1 skipped (len 1/1/1.0) -> Function Scan on generate_series i (actual rows=60.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- JSON Format Tests @@ -2157,7 +2198,9 @@ WINDOW w AS ( "Alias": "s", + "Actual Rows": 50.00, + "Actual Loops": 1, + - "Disabled": false + + "Disabled": false, + + "Storage": "Memory", + + "Maximum Storage": 0 + } + ] + }, + @@ -2237,7 +2280,9 @@ WINDOW w AS ( "Alias": "s", + "Actual Rows": 100.00, + "Actual Loops": 1, + - "Disabled": false + + "Disabled": false, + + "Storage": "Memory", + + "Maximum Storage": 0 + } + ] + }, + @@ -2399,7 +2444,9 @@ WINDOW w AS ( "Alias": "s", + "Actual Rows": 100.00, + "Actual Loops": 1, + - "Disabled": false + + "Disabled": false, + + "Storage": "Memory", + + "Maximum Storage": 0 + } + ] + }, + @@ -2480,6 +2527,8 @@ WINDOW w AS ( 30.00 + 1 + false + + Memory + + 0 + + + + @@ -2563,6 +2612,8 @@ WINDOW w AS ( 100.00 + 1 + false + + Memory + + 0 + + + + @@ -2644,6 +2695,8 @@ WINDOW w AS ( 40.00 + 1 + false + + Memory + + 0 + + + + @@ -2707,8 +2760,10 @@ WINDOW w AS ( Sort Method: quicksort Memory: NkB -> Nested Loop (actual rows=90.00 loops=1) -> Function Scan on generate_series p (actual rows=3.00 loops=1) + Storage: Memory Maximum Storage: NkB -> Function Scan on generate_series v (actual rows=30.00 loops=3) -(14 rows) + Storage: Memory Maximum Storage: NkB +(16 rows) -- Different pattern behavior per partition CREATE VIEW rpr_ev_part_diff AS @@ -2762,7 +2817,8 @@ WINDOW w AS ( Sort Key: (CASE WHEN (v.v <= 25) THEN 1 ELSE 2 END) Sort Method: quicksort Memory: NkB -> Function Scan on generate_series v (actual rows=50.00 loops=1) -(12 rows) + Storage: Memory Maximum Storage: NkB +(13 rows) -- ============================================================ -- Edge Cases @@ -2799,7 +2855,8 @@ WINDOW w AS ( Window: w AS (ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) Pattern: a b -> Function Scan on generate_series s (actual rows=0.00 loops=1) -(4 rows) + Storage: Memory Maximum Storage: NkB +(5 rows) -- Empty matches (length 0): mirror the test_728_* cases in rpr_nfa.sql. -- Window aggregates over a length-0 frame return 0 / NULL, so the SELECT @@ -2842,7 +2899,8 @@ WINDOW w AS ( NFA Contexts: 2 peak, 4 total, 0 pruned NFA: 3 matched (len 0/0/0.0), 0 mismatched -> Function Scan on generate_series s (actual rows=3.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- (A?){1,3}: min=1, one empty iteration satisfies min -> 3 length-0 matches CREATE VIEW rpr_ev_edge_empty_match_min1 AS @@ -2880,7 +2938,8 @@ WINDOW w AS ( NFA Contexts: 2 peak, 4 total, 0 pruned NFA: 3 matched (len 0/0/0.0), 0 mismatched -> Function Scan on generate_series s (actual rows=3.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- (A?){2,3}: min=2 and A never matches, so two empty iterations fill -- the lower bound -> 3 length-0 matches @@ -2919,7 +2978,8 @@ WINDOW w AS ( NFA Contexts: 2 peak, 4 total, 0 pruned NFA: 3 matched (len 0/0/0.0), 0 mismatched -> Function Scan on generate_series s (actual rows=3.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- (A?){2,3} mixed: rows 1-2 match A (real), rows 3-4 fall back to empty CREATE VIEW rpr_ev_edge_empty_match_mixed AS @@ -2957,7 +3017,8 @@ WINDOW w AS ( NFA Contexts: 4 peak, 5 total, 0 pruned NFA: 4 matched (len 0/2/0.8), 0 mismatched -> Function Scan on generate_series s (actual rows=4.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- (A? B?){2,3}: pure empty multi-element body -> 3 length-0 matches CREATE VIEW rpr_ev_edge_empty_match_multi AS @@ -2995,7 +3056,8 @@ WINDOW w AS ( NFA Contexts: 2 peak, 4 total, 0 pruned NFA: 3 matched (len 0/0/0.0), 0 mismatched -> Function Scan on generate_series s (actual rows=3.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Single row CREATE VIEW rpr_ev_edge_single_row AS @@ -3033,7 +3095,8 @@ WINDOW w AS ( NFA Contexts: 2 peak, 2 total, 0 pruned NFA: 1 matched (len 1/1/1.0), 0 mismatched -> Function Scan on generate_series s (actual rows=1.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Pattern longer than data CREATE VIEW rpr_ev_edge_pattern_longer AS @@ -3075,7 +3138,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 6 total, 4 pruned NFA: 0 matched, 1 mismatched (len 5/5/5.0) -> Function Scan on generate_series s (actual rows=5.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- All rows match as single match CREATE VIEW rpr_ev_edge_single_match AS @@ -3114,7 +3178,8 @@ WINDOW w AS ( NFA: 1 matched (len 50/50/50.0), 0 mismatched NFA: 49 absorbed (len 1/1/1.0), 0 skipped -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- Complex Pattern Tests @@ -3156,7 +3221,8 @@ WINDOW w AS ( NFA: 1 matched (len 60/60/60.0), 0 mismatched NFA: 19 absorbed (len 3/3/3.0), 20 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=60.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Multiple alternations CREATE VIEW rpr_ev_cpx_multi_alt AS @@ -3238,7 +3304,8 @@ WINDOW w AS ( NFA: 12 matched (len 3/3/3.0), 1 mismatched (len 2/2/2.0) NFA: 0 absorbed, 12 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Bounded quantifiers CREATE VIEW rpr_ev_cpx_bounded AS @@ -3277,7 +3344,8 @@ WINDOW w AS ( NFA: 10 matched (len 6/6/6.0), 40 mismatched (len 6/6/6.0) NFA: 0 absorbed, 50 skipped (len 1/5/3.0) -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Star quantifier CREATE VIEW rpr_ev_cpx_star AS @@ -3316,7 +3384,8 @@ WINDOW w AS ( NFA: 5 matched (len 9/9/9.0), 0 mismatched NFA: 0 absorbed, 5 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- Real-world Pattern Examples @@ -3437,7 +3506,8 @@ WINDOW w AS ( NFA: 1 matched (len 50/50/50.0), 0 mismatched NFA: 49 absorbed (len 1/1/1.0), 0 skipped -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(10 rows) + Storage: Memory Maximum Storage: NkB +(11 rows) -- ============================================================ -- Performance-oriented Tests @@ -3479,7 +3549,8 @@ WINDOW w AS ( NFA: 500 matched (len 2/2/2.0), 0 mismatched NFA: 0 absorbed, 500 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=1000.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Large dataset with absorption CREATE VIEW rpr_ev_perf_large_absorb AS @@ -3518,7 +3589,8 @@ WINDOW w AS ( NFA: 10 matched (len 100/100/100.0), 0 mismatched NFA: 980 absorbed (len 1/1/1.0), 10 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=1000.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Alternation with plus quantifier over 500 rows CREATE VIEW rpr_ev_perf_high_merge AS @@ -3557,7 +3629,8 @@ WINDOW w AS ( NFA: 166 matched (len 3/3/3.0), 1 mismatched (len 2/2/2.0) NFA: 0 absorbed, 332 skipped (len 1/2/1.5) -> Function Scan on generate_series s (actual rows=500.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- INITIAL vs no INITIAL comparison @@ -3629,7 +3702,8 @@ WINDOW w AS ( NFA: 10 matched (len 3/3/3.0), 0 mismatched NFA: 20 absorbed (len 1/1/1.0), 0 skipped -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Star quantifier (zero or more) CREATE VIEW rpr_ev_quant_star AS @@ -3668,7 +3742,8 @@ WINDOW w AS ( NFA: 10 matched (len 3/3/3.0), 0 mismatched NFA: 10 absorbed (len 1/1/1.0), 10 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Question mark (zero or one) CREATE VIEW rpr_ev_quant_question AS @@ -3707,7 +3782,8 @@ WINDOW w AS ( NFA: 10 matched (len 3/3/3.0), 0 mismatched NFA: 0 absorbed, 20 skipped (len 1/2/1.5) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Exact count {n} CREATE VIEW rpr_ev_quant_exact AS @@ -3746,7 +3822,8 @@ WINDOW w AS ( NFA: 10 matched (len 4/4/4.0), 10 mismatched (len 4/4/4.0) NFA: 0 absorbed, 30 skipped (len 1/3/2.0) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Range {n,m} CREATE VIEW rpr_ev_quant_range AS @@ -3785,7 +3862,8 @@ WINDOW w AS ( NFA: 10 matched (len 5/5/5.0), 0 mismatched NFA: 0 absorbed, 40 skipped (len 1/4/2.5) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- At least {n,} CREATE VIEW rpr_ev_quant_atleast AS @@ -3824,7 +3902,8 @@ WINDOW w AS ( NFA: 5 matched (len 10/10/10.0), 0 mismatched NFA: 40 absorbed (len 1/1/1.0), 5 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- Regression Tests for Statistics Accuracy @@ -3867,7 +3946,8 @@ WINDOW w AS ( NFA: 4 matched (len 5/5/5.0), 0 mismatched NFA: 12 absorbed (len 1/1/1.0), 4 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Verify context count with known absorption CREATE VIEW rpr_ev_reg_ctx_absorb AS @@ -3906,7 +3986,8 @@ WINDOW w AS ( NFA: 3 matched (len 9/9/9.0), 0 mismatched NFA: 18 absorbed (len 1/1/1.0), 3 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=30.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Verify match length with fixed-length pattern CREATE VIEW rpr_ev_reg_matchlen AS @@ -3945,7 +4026,8 @@ WINDOW w AS ( NFA: 10 matched (len 3/3/3.0), 0 mismatched NFA: 0 absorbed, 10 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=30.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- Alternation Pattern Tests @@ -4069,7 +4151,8 @@ WINDOW w AS ( NFA: 16 matched (len 3/3/3.0), 1 mismatched (len 2/2/2.0) NFA: 0 absorbed, 32 skipped (len 1/2/1.5) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Multiple alternatives (4+) CREATE VIEW rpr_ev_alt_four_plus AS @@ -4105,7 +4188,8 @@ WINDOW w AS ( NFA Contexts: 2 peak, 101 total, 0 pruned NFA: 100 matched (len 1/1/1.0), 0 mismatched -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Alternation at start CREATE VIEW rpr_ev_alt_at_start AS @@ -4142,7 +4226,8 @@ WINDOW w AS ( NFA: 15 matched (len 3/3/3.0), 14 mismatched (len 2/2/2.0) NFA: 0 absorbed, 15 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=60.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Multiple sequential alternations CREATE VIEW rpr_ev_alt_sequential AS @@ -4178,7 +4263,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 101 total, 67 pruned NFA: 0 matched, 33 mismatched (len 2/4/3.0) -> Function Scan on generate_series s (actual rows=100.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Quantified alternatives CREATE VIEW rpr_ev_alt_quantified AS @@ -4215,7 +4301,8 @@ WINDOW w AS ( NFA: 20 matched (len 2/2/2.0), 19 mismatched (len 2/2/2.0) NFA: 0 absorbed, 20 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=60.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Alternation at end CREATE VIEW rpr_ev_alt_at_end AS @@ -4252,7 +4339,8 @@ WINDOW w AS ( NFA: 14 matched (len 3/3/3.0), 0 mismatched NFA: 0 absorbed, 14 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=60.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Nested ALT at start of branch inside outer ALT -- Pattern: (A ((B | C) D | E)) - preceding VAR + inner ALT @@ -4290,7 +4378,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 21 total, 17 pruned NFA: 0 matched, 3 mismatched (len 3/3/3.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Nested ALT at end of branch inside outer ALT -- Pattern: (C (A | B) | D) - inner ALT is last element in outer branch @@ -4327,7 +4416,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 21 total, 10 pruned NFA: 5 matched (len 1/1/1.0), 5 mismatched (len 2/2/2.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Quantified group as the first alternation branch -- Pattern: ((A B)+ | C) - leading group branch must open the enclosing paren @@ -4365,7 +4455,8 @@ WINDOW w AS ( NFA: 9 matched (len 1/2/1.4), 0 mismatched NFA: 0 absorbed, 4 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Quantified group as the last alternation branch -- Pattern: (C | (A B)+) - trailing group branch, no separator follows @@ -4403,7 +4494,8 @@ WINDOW w AS ( NFA: 9 matched (len 1/2/1.4), 0 mismatched NFA: 0 absorbed, 4 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Quantified group as the middle branch of a three-way alternation -- Pattern: (C | (A B)+ | D) - separator before D must survive the group branch @@ -4441,7 +4533,8 @@ WINDOW w AS ( NFA: 14 matched (len 1/2/1.3), 0 mismatched NFA: 0 absorbed, 4 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Quantified group as the first branch of a three-way alternation -- Pattern: ((A B)+ | C | D) - leading group branch with two following branches @@ -4479,7 +4572,8 @@ WINDOW w AS ( NFA: 14 matched (len 1/2/1.3), 0 mismatched NFA: 0 absorbed, 4 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Bounded-quantifier group as the first alternation branch -- Pattern: ((A B){2} | C) - leading group branch with a range quantifier @@ -4516,7 +4610,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 21 total, 11 pruned NFA: 5 matched (len 1/1/1.0), 4 mismatched (len 3/3/3.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Two quantified groups in one alternation -- Pattern: ((A B)+ | (C D)+) - both branches are groups @@ -4554,7 +4649,8 @@ WINDOW w AS ( NFA: 9 matched (len 2/2/2.0), 0 mismatched NFA: 0 absorbed, 9 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Leading group branch in an alternation nested in a sequence -- Pattern: (((A B)+ | C) D) - inner alternation opens with a group branch @@ -4592,7 +4688,8 @@ WINDOW w AS ( NFA: 5 matched (len 2/2/2.0), 4 mismatched (len 3/3/3.0) NFA: 0 absorbed, 5 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Trailing group branch in an alternation nested in a sequence -- Pattern: ((C | (A B)+) D) - group as last branch, then a sequence element @@ -4630,7 +4727,8 @@ WINDOW w AS ( NFA: 5 matched (len 2/2/2.0), 4 mismatched (len 3/3/3.0) NFA: 0 absorbed, 5 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Quantified alternation whose first branch is a quantified group -- Pattern: (((A B){2} | C)+) - single-ALT group wraps a leading group branch @@ -4667,7 +4765,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 21 total, 11 pruned NFA: 5 matched (len 1/1/1.0), 4 mismatched (len 3/3/3.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Unit (1,1) group as an alternation branch (emits no BEGIN/END) -- Pattern: ((A B) | C) - control: a {1,1} group emits no BEGIN/END, so the @@ -4706,7 +4805,8 @@ WINDOW w AS ( NFA: 9 matched (len 1/2/1.4), 0 mismatched NFA: 0 absorbed, 4 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Quantified variable as the first alternation branch -- Pattern: (A+ | C) - control: a quantified variable as the leading branch; @@ -4744,7 +4844,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 21 total, 10 pruned NFA: 10 matched (len 1/1/1.0), 0 mismatched -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Quantified group as the last branch of a three-way alternation -- Pattern: (C | D | (A B)+) - control: trailing group needs no separator @@ -4782,7 +4883,8 @@ WINDOW w AS ( NFA: 14 matched (len 1/2/1.3), 0 mismatched NFA: 0 absorbed, 4 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Alternation nested in a leading branch must not swallow the trailing branch -- Pattern: (D (A | B) | E) - inherited limit bounds the inner alternation @@ -4819,7 +4921,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 21 total, 12 pruned NFA: 4 matched (len 1/1/1.0), 4 mismatched (len 2/2/2.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Group mid-branch followed by a sequence element needs no separator before it -- Pattern: (C | (A B)+ D) - only the branch end takes a SEP, not D @@ -4856,7 +4959,8 @@ WINDOW w AS ( NFA Contexts: 3 peak, 21 total, 11 pruned NFA: 5 matched (len 1/1/1.0), 4 mismatched (len 3/3/3.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(8 rows) + Storage: Memory Maximum Storage: NkB +(9 rows) -- Quantified group wrapping a lone alternation: the ALT supplies the parens -- Pattern: ((A | B)+) - loneAlt path, single pair of parens @@ -4894,7 +4998,8 @@ WINDOW w AS ( NFA: 6 matched (len 1/2/1.7), 0 mismatched NFA: 0 absorbed, 4 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Quantified group wrapping a sequence whose last element is an alternation -- Pattern: ((A (B | C))+) - group paren plus a nested alternation paren @@ -4932,7 +5037,8 @@ WINDOW w AS ( NFA: 4 matched (len 2/2/2.0), 0 mismatched NFA: 0 absorbed, 4 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Quantified group wrapping a sequence whose first element is an alternation -- Pattern: (((A | B) C)+) - leading nested alternation inside a group sequence @@ -4970,7 +5076,8 @@ WINDOW w AS ( NFA: 5 matched (len 2/2/2.0), 4 mismatched (len 2/2/2.0) NFA: 0 absorbed, 5 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Alternation non-last in a non-last branch, stacked three deep: each level's -- inherited limit must bound the inner alternation against the next branch @@ -5011,7 +5118,8 @@ WINDOW w AS ( NFA: 6 matched (len 1/2/1.5), 7 mismatched (len 2/3/2.4) NFA: 0 absorbed, 3 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Same interaction stacked four deep, -- to exercise the induction one step further @@ -5053,7 +5161,8 @@ WINDOW w AS ( NFA: 4 matched (len 1/2/1.5), 8 mismatched (len 2/3/2.6) NFA: 0 absorbed, 2 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Three-deep stack whose innermost branch is a quantified group: the group's -- BEGIN-to-END jump must not be mistaken for a branch separator at any depth @@ -5094,7 +5203,8 @@ WINDOW w AS ( NFA: 6 matched (len 1/2/1.5), 7 mismatched (len 2/4/3.1) NFA: 0 absorbed, 3 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Alternation trailing a paren-less sequence (last element of a non-last -- branch, no same-depth sibling to bound it), nested three deep @@ -5135,7 +5245,8 @@ WINDOW w AS ( NFA: 6 matched (len 1/3/2.0), 0 mismatched NFA: 0 absorbed, 3 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Same branch-tail alternation nested four deep -- Pattern: (A (B (C (D | E) | F) | G) | H) - branch-tail alternation x4 @@ -5175,7 +5286,8 @@ WINDOW w AS ( NFA: 4 matched (len 1/4/2.5), 0 mismatched NFA: 0 absorbed, 2 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- A nested alternation tail neighbouring a multi-element sequence branch: the -- branch boundary must split "...branch-tail ALT" from a plain "G A" sequence @@ -5216,7 +5328,8 @@ WINDOW w AS ( NFA: 4 matched (len 1/4/2.5), 0 mismatched NFA: 0 absorbed, 2 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- A nested alternation that is sibling-bounded by a trailing sequence element -- at the outer level (the ALT is not the branch tail; G follows it in-branch) @@ -5258,7 +5371,8 @@ WINDOW w AS ( NFA: 4 matched (len 1/2/1.5), 2 mismatched (len 4/4/4.0) NFA: 0 absorbed, 2 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=20.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- Group Pattern Tests @@ -5300,7 +5414,8 @@ WINDOW w AS ( NFA: 1 matched (len 40/40/40.0), 0 mismatched NFA: 19 absorbed (len 2/2/2.0), 20 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Group with bounded quantifier CREATE VIEW rpr_ev_grp_bounded AS @@ -5339,7 +5454,8 @@ WINDOW w AS ( NFA: 5 matched (len 8/8/8.0), 0 mismatched NFA: 0 absorbed, 30 skipped (len 1/2/1.5) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Nested groups CREATE VIEW rpr_ev_grp_nested AS @@ -5378,7 +5494,8 @@ WINDOW w AS ( NFA: 1 matched (len 60/60/60.0), 0 mismatched NFA: 14 absorbed (len 4/4/4.0), 30 skipped (len 1/2/1.5) -> Function Scan on generate_series s (actual rows=60.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Deep nesting (3+ levels) CREATE VIEW rpr_ev_grp_deep AS @@ -5415,7 +5532,8 @@ WINDOW w AS ( NFA: 1 matched (len 40/40/40.0), 0 mismatched NFA: 0 absorbed, 39 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=40.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Bounded quantifier on alternation CREATE VIEW rpr_ev_grp_bounded_alt AS @@ -5452,7 +5570,8 @@ WINDOW w AS ( NFA: 19 matched (len 3/3/3.0), 1 mismatched (len 2/2/2.0) NFA: 0 absorbed, 38 skipped (len 1/2/1.5) -> Function Scan on generate_series s (actual rows=60.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Nested groups with quantifiers CREATE VIEW rpr_ev_grp_nested_quant AS @@ -5489,7 +5608,8 @@ WINDOW w AS ( NFA: 4 matched (len 0/57/14.2), 0 mismatched NFA: 0 absorbed, 56 skipped (len 1/3/1.6) -> Function Scan on generate_series s (actual rows=60.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Partial nested quantification CREATE VIEW rpr_ev_grp_partial_quant AS @@ -5526,7 +5646,8 @@ WINDOW w AS ( NFA: 4 matched (len 0/57/14.2), 0 mismatched NFA: 0 absorbed, 56 skipped (len 1/3/1.6) -> Function Scan on generate_series s (actual rows=60.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- Window Function Combinations @@ -5568,7 +5689,8 @@ WINDOW w AS ( NFA: 6 matched (len 5/5/5.0), 0 mismatched NFA: 18 absorbed (len 1/1/1.0), 6 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=30.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- first_value with pattern CREATE VIEW rpr_ev_wfn_first_value AS @@ -5607,7 +5729,8 @@ WINDOW w AS ( NFA: 6 matched (len 5/5/5.0), 0 mismatched NFA: 18 absorbed (len 1/1/1.0), 6 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=30.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- last_value with pattern CREATE VIEW rpr_ev_wfn_last_value AS @@ -5646,7 +5769,8 @@ WINDOW w AS ( NFA: 6 matched (len 5/5/5.0), 0 mismatched NFA: 18 absorbed (len 1/1/1.0), 6 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=30.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Multiple window functions CREATE VIEW rpr_ev_wfn_multi AS @@ -5691,7 +5815,8 @@ WINDOW w AS ( NFA: 6 matched (len 5/5/5.0), 0 mismatched NFA: 18 absorbed (len 1/1/1.0), 6 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=30.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- DEFINE Expression Variations @@ -5737,7 +5862,8 @@ WINDOW w AS ( NFA: 17 matched (len 2/3/2.6), 0 mismatched NFA: 10 absorbed (len 1/1/1.0), 17 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=50.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Using PREV function CREATE VIEW rpr_ev_def_prev AS @@ -5782,7 +5908,8 @@ WINDOW w AS ( NFA Contexts: 31 peak, 31 total, 1 pruned NFA: 0 matched, 29 mismatched (len 2/30/16.0) -> Function Scan on generate_series s (actual rows=30.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Using 1-arg PREV (implicit offset 1) CREATE VIEW rpr_ev_nav_prev1 AS @@ -5907,7 +6034,8 @@ WINDOW w AS ( NFA: 6 matched (len 5/5/5.0), 0 mismatched NFA: 18 absorbed (len 1/1/1.0), 6 skipped (len 1/1/1.0) -> Function Scan on generate_series v (actual rows=30.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- Large Scale Statistics Verification @@ -5949,7 +6077,8 @@ WINDOW w AS ( NFA: 50 matched (len 8/9/9.0), 0 mismatched NFA: 299 absorbed (len 1/1/1.0), 50 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=500.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- High match count scenario CREATE VIEW rpr_ev_scale_high_match AS @@ -5988,7 +6117,8 @@ WINDOW w AS ( NFA: 250 matched (len 2/2/2.0), 0 mismatched NFA: 0 absorbed, 250 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=500.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- Sparse five-element pattern over 500 rows CREATE VIEW rpr_ev_scale_high_skip AS @@ -6037,7 +6167,8 @@ WINDOW w AS ( NFA: 5 matched (len 5/5/5.0), 0 mismatched NFA: 0 absorbed, 5 skipped (len 1/1/1.0) -> Function Scan on generate_series s (actual rows=500.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) -- ============================================================ -- Nav Mark Lookback/Lookahead Tests @@ -6710,7 +6841,8 @@ EXPLAIN (ANALYZE, BUFFERS OFF, COSTS OFF, TIMING OFF, SUMMARY OFF) NFA Contexts: 2 peak, 11 total, 10 pruned NFA: 0 matched, 0 mismatched -> Function Scan on generate_series s (actual rows=10.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) RESET plan_cache_mode; DEALLOCATE test_overflow_lookback; @@ -6738,7 +6870,8 @@ EXPLAIN (ANALYZE, BUFFERS OFF, COSTS OFF, TIMING OFF, SUMMARY OFF) NFA Contexts: 2 peak, 11 total, 10 pruned NFA: 0 matched, 0 mismatched -> Function Scan on generate_series s (actual rows=10.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) RESET plan_cache_mode; DEALLOCATE test_overflow_lookahead; @@ -6933,7 +7066,8 @@ EXECUTE test_eval_prevfirst(3, 1);'); NFA Contexts: 2 peak, 11 total, 10 pruned NFA: 0 matched, 0 mismatched -> Function Scan on generate_series s (actual rows=10.00 loops=1) -(9 rows) + Storage: Memory Maximum Storage: NkB +(10 rows) RESET plan_cache_mode; DEALLOCATE test_eval_prevfirst; -- 2.54.0 (Apple Git-157)