pgsql: Eat XIDs more efficiently in recovery TAP test.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Eat XIDs more efficiently in recovery TAP test.
Date: 2017-06-29 02:11:17
Message-ID: E1dQOvN-0001Dc-Gn@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Eat XIDs more efficiently in recovery TAP test.

The point of this loop is to insert 1000 rows into the test table
and consume 1000 XIDs. I can't see any good reason why it's useful
to launch 1000 psqls and 1000 backend processes to accomplish that.
Pushing the looping into a plpgsql DO block shaves about 10 seconds
off the runtime of the src/test/recovery TAP tests on my machine;
that's over 10% of the runtime of that test suite.

It is, in fact, sufficiently more efficient that we now demonstrably
need wait_slot_xmins() afterwards, or the slaves' xmins may not have
moved yet.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/08aed6604de2e6a9f4d499818d7c641cbf5eb9f7

Modified Files
--------------
src/test/recovery/t/001_stream_rep.pl | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-06-30 12:55:21 pgsql: Copy collencoding in CREATE COLLATION / FROM
Previous Message Tom Lane 2017-06-28 22:00:21 pgsql: Ooops, WIN32 code in pg_ctl.c still needs PQExpBuffer.