Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v8T1V-0016sU-Jr for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Oct 2025 00:36:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v8T1S-009NxI-9b for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Oct 2025 00:36:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v8T1R-009NxA-W8 for pgsql-hackers@lists.postgresql.org; Tue, 14 Oct 2025 00:36:14 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v8T1Q-0021Vn-1X for pgsql-hackers@lists.postgresql.org; Tue, 14 Oct 2025 00:36:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 59E0a7HX845487; Mon, 13 Oct 2025 20:36:07 -0400 From: Tom Lane To: Chao Li cc: Dimitrios Apostolou , Nathan Bossart , Thomas Munro , pgsql-hackers@lists.postgresql.org Subject: Re: [PING] [PATCH v2] parallel pg_restore: avoid disk seeks when jumping short distance forward In-reply-to: <25A25667-AC82-46FD-A5FC-0B2AA0CC7DB9@gmail.com> References: <2edb7a57-b225-3b23-a680-62ba90658fec@gmx.net> <1282067.1744651649@sss.pgh.pa.us> <5ed51587-5a24-4d79-e36e-927620d0e3a2@gmx.net> <72d2c81b-a0fe-3d99-9dd4-0d771e6e673e@gmx.net> <1po8os49-r63o-2923-p37n-12698o1qn7p0@tzk.arg> <3515357.1760128017@sss.pgh.pa.us> <3698234.1760149336@sss.pgh.pa.us> <3686.1760232320@sss.pgh.pa.us> <717335.1760389672@sss.pgh.pa.us> <25A25667-AC82-46FD-A5FC-0B2AA0CC7DB9@gmail.com> Comments: In-reply-to Chao Li message dated "Tue, 14 Oct 2025 08:09:56 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <845485.1760402167.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 13 Oct 2025 20:36:07 -0400 Message-ID: <845486.1760402167@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Chao Li writes: > I tested DEFAULT_IO_BUFFER_SIZE with 4K, 32K, 64K, 128K and 256K. Looks = like increasing the buffer size doesn=E2=80=99t improve the performance si= gnificantly. Actually, with the buffer size 64K, 128K and 256K, the test r= esults are very close. I tested both with lz4 and none compression. I am n= ot suggesting tuning the buffer size. These data are only for your referen= ce. Yeah, I would not expect straight pg_dump/pg_restore performance to vary very much once the buffer size gets above not-too-many KB. The thing we are really interested in here is how fast pg_restore can skip over unwanted table data in a large archive file, and that I believe should be pretty sensitive to block size. You could measure that without getting into the complexities of parallel restore if you make a custom-format dump of a few large tables that does not have offset data in it, and then seeing how fast is selective restore of just the last table. regards, tom lane