Re: Row pattern recognition

From: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
To: champion(dot)p(at)gmail(dot)com, er(at)xs4all(dot)nl, vik(at)postgresfriends(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Row pattern recognition
Date: 2023-10-04 06:03:28
Message-ID: 20231004.150328.1839536731767076406.t-ishii@sranhm.sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> By the way, I was thinking about eliminating recusrive calls in
> pattern matching. Attached is the first cut of the implementation. In
> the attached v8 patch:
>
> - No recursive calls anymore. search_str_set_recurse was removed.
>
> - Instead it generates all possible pattern variable name initial
> strings before pattern matching. Suppose we have "ab" (row 0) and
> "ac" (row 1). "a" and "b" represents the pattern variable names
> which are evaluated to true. In this case it will generate "aa",
> "ac", "ba" and "bc" and they are examined by do_pattern_match one by
> one, which performs pattern matching.
>
> - To implement this, an infrastructure string_set* are created. They
> take care of set of StringInfo.
>
> I found that the previous implementation did not search all possible
> cases. I believe the bug is fixed in v8.

The v8 patch does not apply anymore due to commit d060e921ea "Remove obsolete executor cleanup code".
So I rebased and created v9 patch. The differences from the v8 include:

- Fix bug with get_slots. It did not correctly detect the end of full frame.
- Add test case using "ROWS BETWEEN CURRENT ROW AND offset FOLLOWING".

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

Attachment Content-Type Size
v9-0001-Row-pattern-recognition-patch-for-raw-parser.patch text/x-patch 21.1 KB
v9-0002-Row-pattern-recognition-patch-parse-analysis.patch text/x-patch 11.6 KB
v9-0003-Row-pattern-recognition-patch-planner.patch text/x-patch 4.8 KB
v9-0004-Row-pattern-recognition-patch-executor.patch text/x-patch 39.1 KB
v9-0005-Row-pattern-recognition-patch-docs.patch text/x-patch 8.2 KB
v9-0006-Row-pattern-recognition-patch-tests.patch text/x-patch 37.5 KB
v9-0007-Allow-to-print-raw-parse-tree.patch text/x-patch 748 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-10-04 06:20:01 Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag
Previous Message shveta malik 2023-10-04 05:54:20 Re: Synchronizing slots from primary to standby