RE: Parallel Apply

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Tomas Vondra <tomas(at)vondra(dot)me>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, 'Dilip Kumar' <dilipbalaut(at)gmail(dot)com>, 'Andrei Lepikhov' <lepihov(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, 'wenhui qiu' <qiuwenhuifx(at)gmail(dot)com>
Subject: RE: Parallel Apply
Date: 2025-12-26 03:20:35
Message-ID: OSCPR01MB14966B464C274665B21FF4320F5B0A@OSCPR01MB14966.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Hackers,

Here is a rebased version.
Since the parallel worker's bug has been fixed, the patch is not attached anymore.

0006 contains changes to handle the case that user-defined triggers are not
immutable. Some triggers may change their behaviors based on the number of tuples
and other internal states. To keep the result consistent with the non-parallel
case, parallel workers wait to apply changes till the previous transaction is
committed if the target relation has such triggers.
Note that we assume CHECK constraints are immutable, so they are not checked.
I think it is a reasonable assumption because it has already been described in
the doc [1].
(This does not contain tests yet)

0007 contains changes for track dependencies by local indexes. It was mostly the
same as v5-0008. Since I cannot find a reasonable way to compute a hash for
expression indexes, these indexes are no longer used for tracking. Instead, the
parallel worker waits to apply changes till the previous transaction is
committed if the target relation has such indexes.

[1]: https://www.postgresql.org/docs/current/ddl-constraints.html

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment Content-Type Size
v6-0001-Introduce-a-shared-hash-table-to-store-paralleliz.patch application/octet-stream 8.7 KB
v6-0002-Introduce-a-local-hash-table-to-store-replica-ide.patch application/octet-stream 27.7 KB
v6-0003-Parallel-apply-non-streaming-transactions.patch application/octet-stream 51.7 KB
v6-0004-support-2PC.patch application/octet-stream 13.3 KB
v6-0005-Track-dependencies-for-streamed-transactions.patch application/octet-stream 10.7 KB
v6-0006-Wait-applying-transaction-if-one-of-user-defined-.patch application/octet-stream 11.8 KB
v6-0007-Support-dependency-tracking-via-local-unique-inde.patch application/octet-stream 23.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2025-12-26 03:37:58 Re: [Patch]Add tab completion for DELETE ... USING
Previous Message Chao Li 2025-12-26 01:11:48 Re: Switch buffile.c/h to use pgoff_t