Re: Row pattern recognition

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: assam258(at)gmail(dot)com
Cc: ishii(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org, 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
Subject: Re: Row pattern recognition
Date: 2026-07-04 01:22:24
Message-ID: CACJufxFDkF0_JjHh--d4cbakaCG6X=c7RHYENGMyrudKnBT1-g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 4, 2026 at 6:22 AM Henson Choi <assam258(at)gmail(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message jian he 2026-07-04 01:09:22 Re: implement CAST(expr AS type FORMAT 'template')