Re: Row pattern recognition - Mailing list pgsql-hackers

From jian he
Subject Re: Row pattern recognition
Date
Msg-id CACJufxFDkF0_JjHh--d4cbakaCG6X=c7RHYENGMyrudKnBT1-g@mail.gmail.com
Whole thread
In response to Re: Row pattern recognition  (Henson Choi <assam258@gmail.com>)
List 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.



pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: implement CAST(expr AS type FORMAT 'template')
Next
From: Thomas Munro
Date:
Subject: MinGW ccache snafu on CI