Re: Row pattern recognition

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: assam258@gmail.com
Cc: 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-07-04T01:22:24Z
Lists: pgsql-hackers
On Sat, Jul 4, 2026 at 6:22 AM Henson Choi <assam258@gmail.com> wrote:
>
> Hi Tatsuo,
>
> > In v50-0006-tidy-plumbing.patch, the planner cost model seems slightly
> > changed. Before the cost was charged according to the number of
> > pattern variables in PATTERN clause. But now it is charged according
> > to the number of pattern variables in DEFINE clause. Maybe I missed
> > the discussion on the changing. Can you please explain the reason of
> > the change?
>
> The change is a simplification that came out of Jian's v48 review, and it
> does not change the cost the model produces.
>
> It follows Jian's suggestion from 2026-06-15 [1]:
>
> ....
>
> This also matches the premise of the cost model we settled on back in
> February: the NFA executor evaluates every DEFINE expression once per row,
> so the natural unit for the per-tuple charge is the DEFINE variable.
>
> [1] https://www.postgresql.org/message-id/CACJufxFAQhbOD9EVCTAy-VwDbG4446N10GsxCcgdpFnjHO1Efw%40mail.gmail.com
>
> Best regards,
> Henson

I am wondering if we can have one query to enable (COSTS ON) for testing.

For many rpr tests, the table size is small, EXPLAIN ANALYZE won't
take long, and probably all rows will be sampled.
Of course, once the patch is in committable shape, we need to switch it to OFF.



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