Some parameters specified in postgresql.conf
=====================================================
shared_buffers = 8GB
checkpoint_timeout = 30min
max_wal_size = 20GB
min_wal_size = 10GB
autovacuum = off


Steps
=====================================================
-- Create table in the publisher and the subscriber
CREATE TABLE large_test (
     id int primary key,
     num1 bigint,
     num2 double precision,
     num3 double precision
);

-- Create publication
-- 10% of rows are sent
create publication pub_10 for table large_test where(id%100 < 10);
-- 5% of rows are sent
create publication pub_5 for table large_test where(id%100 < 5);
-- 0% of rows are sent
create publication pub_0 for table large_test where(id%100 < 0);


-- Create subscription

-- HEAD:

-- 10% of rows are sent
CREATE SUBSCRIPTION sub CONNECTION 'port=5432 dbname=postgres' PUBLICATION pub_10 with(streaming=on);
-- 5% of rows are sent
CREATE SUBSCRIPTION sub CONNECTION 'port=5432 dbname=postgres' PUBLICATION pub_5 with(streaming=on);
-- 0% of rows are sent
CREATE SUBSCRIPTION sub CONNECTION 'port=5432 dbname=postgres' PUBLICATION pub_0 with(streaming=on);

-- after applying patch:

CREATE SUBSCRIPTION sub CONNECTION 'port=5432 dbname=postgres' PUBLICATION pub_10 with(streaming=parallel);
-- 5% of rows are sent
CREATE SUBSCRIPTION sub CONNECTION 'port=5432 dbname=postgres' PUBLICATION pub_5 with(streaming=parallel);
-- 0% of rows are sent
CREATE SUBSCRIPTION sub CONNECTION 'port=5432 dbname=postgres' PUBLICATION pub_0 with(streaming=parallel);


Then set synchronous replication and restart publisher server.

-- empty the table
TRUNCATE large_test;
-- execute the SQL and record the execution time.
INSERT INTO large_test (id, num1, num2, num3)
     SELECT i, round(random()*10), random(), random()*142
     FROM generate_series(1, 10000000) s(i);
