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 1uygRf-00BKlt-Vc for pgsql-general@arkaria.postgresql.org; Wed, 17 Sep 2025 00:54:51 +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 1uygRb-003dev-CU for pgsql-general@arkaria.postgresql.org; Wed, 17 Sep 2025 00:54:48 +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 1uygRb-003dem-1A for pgsql-general@lists.postgresql.org; Wed, 17 Sep 2025 00:54:47 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uygRU-001DjI-0t for pgsql-general@lists.postgresql.org; Wed, 17 Sep 2025 00:54:47 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-267fa729a63so850465ad.3 for ; Tue, 16 Sep 2025 17:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758070479; x=1758675279; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CUvoJJYQIxHauL732oV7/NfoSI+kbA/J/A4lQhfMRzw=; b=alo9o6vvhDJRzSKUi7sw+5Otus7vyN1CPttHlW82m5rAl8Xg7Y2lGSPQCSNFINbYbv zpht6Neu212tJpFgrD+DQdMpZXcwgNeN+I8xyCdfkcVJRYQYQLjXjvQ0bZP51uUsi1pA 0BmEMMDX4kEKp1ur7WJkWyVXkLeACRDhQPQ9pGMq19T44QUJPQtwtUO6/299soGuAdmo 6gA1PYdAagNQMAbkP6inKVB14mth9ObDxglgL2zdyB/kewlsP3oH46kLz10nIaXGT5fJ 2cZ8TzchJ140qFOSrpP1tJcU+rfUYjoXXd0gMTyLr22PcN6v5W3+WfwgQrgY8+ymWxnd qfpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758070479; x=1758675279; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CUvoJJYQIxHauL732oV7/NfoSI+kbA/J/A4lQhfMRzw=; b=bJXdmjQf5P+Ta9rSOI+hJRlgW0E5FMEABzhC60tvrYcT+z72EPB091eB6HjNqbcmZE m83h+8iUi3c+wQyMeQGldCk44Obo4NUNmBKJjJpqhlOvKUJoDKw1fyDkq9uNxa3LbCnh FE6YnI0wNasUndB5VuyTRf8Csx6pmLxBrhGY0enoVvgZWmJGFsduE6cRlgfmlZKcaNtx J3NrsMyo/Tm38O6VIKEnGzFq/Wx5beSVruMwa9v03Ma4lhy2xEeDggMUi1uZvuGiRIwz qcb5uxuKTzzUGb6B6YcjEmdnx56Ra8ho5wDbfzvQ1qqBaSBrPR2gQ1ORJHm855aCNAWu 41iQ== X-Gm-Message-State: AOJu0Yw+wF7kjz1hAQTTPGgPtX7so71Ceu/dh3a/tAsFTC0g5bmrlmAL wwmuV2wNpeShyMoG6MpLGidcg1kDmhu/oXSok6w/EqO0HXUdmAm1hZuhAc6lqjWzPX4198CCNzg IRe/NQpRhDdQFxb3ySLz15kYNPGcyhNA= X-Gm-Gg: ASbGncsdQogCHUdWv1EXJ14MGpl5uCqxMAtvMd4XAPYyGFOgT90CCEdQMSX1UMT9b2+ 7AnCGaSITPX5f4dVOn1ao4P94gv1zdJ3sn/2otBPSwZJ3Z2FIN60CJvSdjnGdYp8M9sCayfSq4x 7erTWIA9RYQ0WHZi/CaHMj04/6mjQH7jqbt61CfIAwMxx6CRfqTKkKbzvBMPi1yU52HNx2xQvRy n1l6rV28h7p4KfNENSC X-Google-Smtp-Source: AGHT+IH2VpeCjC5sL27FEq5nIHwVUAajr+6qo24KqlZU7SR/so1rxAG/TeYkLjO36kX9pzsmfH5ySBfa4114Bu/c8ao= X-Received: by 2002:a17:903:320e:b0:24c:c445:87c2 with SMTP id d9443c01a7336-2681286bac1mr1407715ad.4.1758070479375; Tue, 16 Sep 2025 17:54:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: R Wahyudi Date: Wed, 17 Sep 2025 10:54:27 +1000 X-Gm-Features: AS18NWBCZFvrvzxiI_o74OPGJY2VdEwxFjwiqlYtbKbsAmpQb-ldhWM9rL4qBH4 Message-ID: Subject: Re: pg_restore scan To: Adrian Klaver Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000069d20a063ef4ae49" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000069d20a063ef4ae49 Content-Type: text/plain; charset="UTF-8" pg_dump was done using the following command : pg_dump -Fc -Z 0 -h -U -w -d On Wed, 17 Sept 2025 at 08:36, Adrian Klaver wrote: > On 9/16/25 15:25, R Wahyudi wrote: > > > > I'm trying to troubleshoot the slowness issue with pg_restore and > > stumbled across a recent post about pg_restore scanning the whole file : > > > > > "scanning happens in a very inefficient way, with many seek calls and > > small block reads. Try strace to see them. This initial phase can take > > hours in a huge dump file, before even starting any actual restoration." > > see : https://www.postgresql.org/message-id/E48B611D-7D61-4575-A820- > > B2C3EC2E0551%40gmx.net > E48B611D-7D61-4575-A820-B2C3EC2E0551%40gmx.net> > > This was for pg_dump output that was streamed to a Borg archive and as > result had no object offsets in the TOC. > > How are you doing your pg_dump? > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > --00000000000069d20a063ef4ae49 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
pg_dump was done using the following command= :=C2=A0
pg_dump -Fc -Z 0 -h <host> -U <user> -w -d <data= base>=C2=A0

On Wed, 17 Sept 2025 at 08:36, Ad= rian Klaver <adrian.klaver@= aklaver.com> wrote:
On 9/16/25 15:25, R Wahyudi wrote:
>
> I'm trying to troubleshoot the slowness issue with pg_restore and =
> stumbled across a recent post about pg_restore scanning the whole file= :
>
>=C2=A0 > "scanning happens in a very inefficient way, with many= seek calls and
> small block reads. Try strace to see them. This initial phase can take=
> hours in a huge dump file, before even starting any actual restoration= ."
> see : https://www.postgresql.org/= message-id/E48B611D-7D61-4575-A820-
> B2C3EC2E0551%40gmx.net <https://www.postgresql.org/message-= id/
> E48B611D-7D61-4575-A820-B2C3EC2E0551%40gmx.net>

This was for pg_dump output that was streamed to a Borg archive and as
result had no object offsets in the TOC.

How are you doing your pg_dump?



--
Adrian Klaver
adrian.klave= r@aklaver.com
--00000000000069d20a063ef4ae49--