Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Dilip Kumar <dilipbalaut@gmail.com>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Tighten the concurrent abort check during decoding.
- 2ce353fc1902 14.0 landed
-
Improve hash_create()'s API for some added robustness.
- b3817f5f7746 14.0 landed
-
Use HASH_BLOBS for xidhash.
- a1b8aa1e4eec 14.0 landed
-
Fix initialization of RelationSyncEntry for streaming transactions.
- 69bd60672af6 14.0 landed
-
Remove unused function declaration in logicalproto.h.
- ddd5f6d2609b 14.0 landed
-
Add additional tests to test streaming of in-progress transactions.
- 58b5ae9d62bd 14.0 landed
-
Fix inline marking introduced in commit 464824323e.
- ac15b499f7f9 14.0 landed
-
Add support for streaming to built-in logical replication.
- 464824323e57 14.0 landed
-
Fix the SharedFileSetUnregister API.
- 4ab77697f67a 14.0 landed
-
Fix comment in procarray.c
- 77c7267c37f7 14.0 cited
-
Suppress compiler warning in non-cassert builds.
- e942af7b8261 14.0 cited
-
Extend the BufFile interface.
- 808e13b282ef 14.0 landed
-
Mark a few logical decoding related variables with PGDLLIMPORT.
- b48cac3b10a0 14.0 landed
-
Implement streaming mode in ReorderBuffer.
- 7259736a6e5b 14.0 landed
-
Extend the logical decoding output plugin API with stream methods.
- 45fdc9738b36 14.0 landed
-
WAL Log invalidations at command end with wal_level=logical.
- c55040ccd017 14.0 landed
-
Immediately WAL-log subtransaction and top-level XID association.
- 0bead9af484c 14.0 landed
-
Allow logical replication to transfer data in binary format.
- 9de77b545313 14.0 cited
-
Only superuser can set sslcert/sslkey in postgres_fdw user mappings
- cebf9d6e6ee1 13.0 cited
-
Track statistics for spilling of changes from ReorderBuffer.
- 9290ad198b15 13.0 landed
-
Add logical_decoding_work_mem to limit ReorderBuffer memory usage.
- cec2edfa7859 13.0 landed
-
logical decoding: process ASSIGNMENT during snapshot build
- bac2fae05c77 13.0 cited
-
Emit invalidations to standby for transactions without xid.
- c6ff84b06a68 9.6.0 cited
On Mon, Nov 4, 2019 at 2:43 PM Kuntal Ghosh <kuntalghosh.2007@gmail.com> wrote: > > Hello hackers, > > I've done some performance testing of this feature. Following is my > test case (taken from an earlier thread): > > postgres=# CREATE TABLE large_test (num1 bigint, num2 double > precision, num3 double precision); > postgres=# \timing on > postgres=# EXPLAIN (ANALYZE, BUFFERS) INSERT INTO large_test (num1, > num2, num3) SELECT round(random()*10), random(), random()*142 FROM > generate_series(1, 1000000) s(i); > > I've kept the publisher and subscriber in two different system. > > HEAD: > With 1000000 tuples, > Execution Time: 2576.821 ms, Time: 9.632.158 ms (00:09.632), Spill count: 245 > With 10000000 tuples (10 times more), > Execution Time: 30359.509 ms, Time: 95261.024 ms (01:35.261), Spill count: 2442 > > With the memory accounting patch, following are the performance results: > With 100000 tuples, > logical_decoding_work_mem=64kB, Execution Time: 2414.371 ms, Time: > 9648.223 ms (00:09.648), Spill count: 2315 > logical_decoding_work_mem=64MB, Execution Time: 2477.830 ms, Time: > 9895.161 ms (00:09.895), Spill count 3 > With 1000000 tuples (10 times more), > logical_decoding_work_mem=64kB, Execution Time: 38259.227 ms, Time: > 105761.978 ms (01:45.762), Spill count: 23149 > logical_decoding_work_mem=64MB, Execution Time: 24624.639 ms, Time: > 89985.342 ms (01:29.985), Spill count: 23 > > With logical decoding of in-progress transactions patch and with > streaming on, following are the performance results: > With 100000 tuples, > logical_decoding_work_mem=64kB, Execution Time: 2674.034 ms, Time: > 20779.601 ms (00:20.780) > logical_decoding_work_mem=64MB, Execution Time: 2062.404 ms, Time: > 9559.953 ms (00:09.560) > With 1000000 tuples (10 times more), > logical_decoding_work_mem=64kB, Execution Time: 26949.588 ms, Time: > 196261.892 ms (03:16.262) > logical_decoding_work_mem=64MB, Execution Time: 27084.403 ms, Time: > 90079.286 ms (01:30.079) So your result shows that with "streaming on", performance is degrading? By any chance did you try to see where is the bottleneck? -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com