Re: Perform streaming logical transactions by background workers and parallel apply
shveta malik <shveta.malik@gmail.com>
Attachments
- scripts.zip (application/x-zip-compressed)
On Tue, Jan 3, 2023 at 11:10 AM wangw.fnst@fujitsu.com <wangw.fnst@fujitsu.com> wrote: > > On Mon, Jan 2, 2023 at 18:54 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > On Fri, Dec 30, 2022 at 3:55 PM wangw.fnst@fujitsu.com > > <wangw.fnst@fujitsu.com> wrote: > > > > > > I've checked it and it looks good to me. > > > Rebased the other patches and ran the pgident for the patch set. > > > > > > Attach the new patch set. > > > > > > > I have added a few DEBUG messages and changed a few comments in the > > 0001 patch. With that v71-0001* looks good to me and I'll commit it > > later this week (by Thursday or Friday) unless there are any major > > comments or objections. > > Thanks for your improvement. > > Rebased the patch set because the new change in HEAD (c8e1ba7). > Attach the new patch set. > > Regards, > Wang wei Hi, In continuation with [1] and [2], I did some performance testing on v70-0001 patch. This test used synchronous logical replication and compared SQL execution times before and after applying the patch. The following cases are tested by varying logical_decoding_work_mem: a) Bulk insert. b) Bulk delete c) Bulk update b) Rollback to savepoint. (different percentages of changes in the transaction are rolled back). The tests are performed ten times, and the average of the middle eight is taken. The scripts are the same as before [1]. The scripts for additional update and delete testing are attached. The results are as follows: RESULT - bulk insert (5kk) --------------------------------------------------------------- logical_decoding_work_mem 64kB 256kB 64MB HEAD 34.475 34.222 34.400 patched 20.168 20.181 20.510 Compare with HEAD -41.49% -41.029% -40.377% RESULT - bulk delete (5kk) --------------------------------------------------------------- logical_decoding_work_mem 64kB 256kB 64MB HEAD 40.286 41.312 41.312 patched 23.749 23.759 23.480 Compare with HEAD -41.04% -42.48% -43.16% RESULT - bulk update (5kk) --------------------------------------------------------------- logical_decoding_work_mem 64kB 256kB 64MB HEAD 63.650 65.260 65.459 patched 46.692 46.275 48.281 Compare with HEAD -26.64% -29.09% -26.24% RESULT - rollback 10% (5kk) --------------------------------------------------------------- logical_decoding_work_mem 64kB 256kB 64MB HEAD 33.386 33.213 31.990 patched 20.540 19.295 18.139 Compare with HEAD -38.47% -41.90% -43.29% RESULT - rollback 20% (5kk) --------------------------------------------------------------- logical_decoding_work_mem 64kB 256kB 64MB HEAD 32.150 31.871 30.825 patched 19.331 19.366 18.285 Compare with HEAD -39.87% -39.23% -40.68% RESULT - rollback 30% (5kk) --------------------------------------------------------------- logical_decoding_work_mem 64kB 256kB 64MB HEAD 28.611 30.139 29.433 patched 19.632 19.838 18.374 Compare with HEAD -31.38% -34.17% -37.57% RESULT - rollback 50% (5kk) --------------------------------------------------------------- logical_decoding_work_mem 64kB 256kB 64MB HEAD 27.410 27.167 25.990 patched 19.982 18.749 18.048 Compare with HEAD -27.099% -30.98% -30.55% (if "Compare with HEAD" is a positive number, it means worse than HEAD; if it is a negative number, it means better than HEAD.) Summary: Update shows 26-29% improvement, while insert and delete shows ~40% improvement. In the case of rollback, the improvement is somewhat between 27-42%. The improvement slightly decreases with larger amounts of data being rolled back. [1] https://www.postgresql.org/message-id/OSZPR01MB63103AA97349BBB858E27DEAFD499%40OSZPR01MB6310.jpnprd01.prod.outlook.com [2] https://www.postgresql.org/message-id/OSZPR01MB6310174063C9144D2081F657FDE09%40OSZPR01MB6310.jpnprd01.prod.outlook.com thanks Shveta
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix invalid memory access during the shutdown of the parallel apply worker.
- 3d144c6c8602 16.0 landed
-
Fix assertion failure in apply worker.
- de63f8dadee4 16.0 landed
-
Use elog to report unexpected action in handle_streamed_transaction().
- 781ac42d43ab 16.0 landed
-
Use appropriate wait event when sending data in the apply worker.
- d9d7fe68d35e 16.0 landed
-
Allow the logical_replication_mode to be used on the subscriber.
- 9f2213a7c575 16.0 landed
-
Rename GUC logical_decoding_mode to logical_replication_mode.
- 1e8b61735cfb 16.0 landed
-
Display the leader apply worker's PID for parallel apply workers.
- d540a02a724b 16.0 landed
-
Improve the code to decide and process the apply action.
- c981d9145dea 16.0 landed
-
Document the newly added wait events added by commit 216a784829.
- cd06ccd78fcf 16.0 landed
-
Perform apply of large transactions by parallel workers.
- 216a784829c2 16.0 landed
-
Wake up a subscription's replication worker processes after DDL.
- c6e1f62e2cee 16.0 cited
-
Add copyright notices to meson files
- 8284cf5f746f 16.0 cited
-
Better document logical replication parameters
- a8500750ca0a 16.0 cited
-
Add a common function to generate the origin name.
- 776e1c8a5d14 16.0 cited
-
Harmonize parameter names in storage and AM code.
- bfcf1b34805f 16.0 cited
-
Avoid using list_length() to test for empty list.
- efd0c16becbf 16.0 cited
-
Improve two comments related to a boolean DefElem's value
- 8445f5a21d40 16.0 cited
-
Fix partition table's REPLICA IDENTITY checking on the subscriber.
- 26b3455afaa9 15.0 cited
-
Fix data inconsistency between publisher and subscriber.
- b7658c24c7c1 15.0 cited
-
Fix cache look-up failures while applying changes in logical replication.
- 5a97b1325453 15.0 cited