Re: Row pattern recognition

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, jchampion(at)timescale(dot)com
Cc: er(at)xs4all(dot)nl, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Row pattern recognition
Date: 2023-09-09 13:32:41
Message-ID: b3c40fdd-f5ee-682d-53fd-8593fd65c80f@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/9/23 13:21, Tatsuo Ishii wrote:
> Thanks for the explanation. Surprising concet of the standard:-)

<quote from 19075-5:2023>

This leaves the choice between traditional NFA and Posix NFA. The
difference between these is that a traditional NFA exits (declares a
match) as soon as it finds the first possible match, whereas a Posix NFA
is obliged to find all possible matches and then choose the “leftmost
longest”. There are examples that show that, even for conventional
regular expression matching on text strings and without back references,
there are patterns for which a Posix NFA is orders of magnitude slower
than a traditional NFA. In addition, reluctant quantifiers cannot be
defined in a Posix NFA, because of the leftmost longest rule.

Therefore it was decided not to use the Posix NFA model, which leaves
the traditional NFA as the model for row pattern matching. Among
available tools that use traditional NFA engines, Perl is the most
influential; therefore Perl was adopted as the design target for pattern
matching rules.

</quote>

> Is it different from SIMILAR TO REs too?

Of course it is. :-) SIMILAR TO uses its own language and rules.

> What if we don't follow the standard, instead we follow POSIX EREs? I
> think this is better for users unless RPR's REs has significant merit
> for users.

This would get big pushback from me.
--
Vik Fearing

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2023-09-09 15:14:50 Re: Possibility to disable `ALTER SYSTEM`
Previous Message Michael Paquier 2023-09-09 12:13:38 Re: Suspicious redundant assignment in COPY FROM