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 1u029i-00AN9C-CZ for pgsql-general@arkaria.postgresql.org; Wed, 02 Apr 2025 17:45:38 +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 1u029g-00Gl9P-DX for pgsql-general@arkaria.postgresql.org; Wed, 02 Apr 2025 17:45:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u029g-00Gl9E-1y for pgsql-general@lists.postgresql.org; Wed, 02 Apr 2025 17:45:36 +0000 Received: from fout-b1-smtp.messagingengine.com ([202.12.124.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u029e-002aqO-0c for pgsql-general@lists.postgresql.org; Wed, 02 Apr 2025 17:45:35 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id F07E71140141; Wed, 2 Apr 2025 13:45:32 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Wed, 02 Apr 2025 13:45:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1743615932; x=1743702332; bh=sg31gPaieVIMmGvyc2Mn4riaOFtWam/77o5PbRtDwn4=; b= BWmGvH/DZKhJ9KrFu3FvUa3wt6KF3ZN1rSDRfKWCj4Oh8edM1wOrCxb85SZ9X7Ki D7dEQGGubZobbM75Wq90vu7RY17PsTPZQ0SgixXQR3Yfd1qNFBstA/gKG0ctSTCg n5HRg9OAKqwiPJONyEewW9Glvt6GnY+ePrso4OeTkEmBCuD4WXWVW0g71xwufaTR gq+nQy85a4HvO8Se+6fAGFNFhoCGr+ApWTapU/IFFGa3TpUDVOsLCVoDYlMOq1TA RuWRAUjVyc2Z5eEWYOXkXjkfq8AGNcfTTizRCgmnrCDTURcXdLCZ89gxoVJMbB8f ZgMf6Ee2OicoDXgGLBU9XQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1743615932; x=1743702332; bh=s g31gPaieVIMmGvyc2Mn4riaOFtWam/77o5PbRtDwn4=; b=wKKfPZ8yf/gsXwO52 Nl8KywPsNeB2dCkPlsui7wMr63YBCwBdElgMwI+1STTAO/IThvokgGN4tnq1tidm szLpLHxneCB9KqH0C9h2QLZXHxchxa4dltUKiHxOQSTwpz0jVKGFbcxnqkqM6zU9 9VYAFA+kHKkbKAJbFzOjp3fKlRqkTN2aKbnEFOcYpIyGwZ8R6Q87Hu2kkYBi9Gge Ofc2fQ1O5Mb7Atxh5DOfbRGcrnIYXG/YzteDmxyCFvWpcsc0CI4xSKGB3JJATo3o 42cQYpkpzRLtbB4ZngD6CCk8HkELAQ5+TP7ehkrXR7HmnKaWoCdeCQfwaLuqRuDk 7PKQA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddukeeivdelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkff ggfgfuhffvfhgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghv vghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrf grthhtvghrnhepudffkeelueehffdtieetkedttdevvedvffeiffduhefggeettdetheff ueetgeefnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghv vghrsegrkhhlrghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmth hpohhuthdprhgtphhtthhopehjihhmihhssehgmhigrdhnvghtpdhrtghpthhtohepphhg shhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Apr 2025 13:45:31 -0400 (EDT) Message-ID: <7be2dcc6-3ba4-4e3f-a154-8d13d816aa9b@aklaver.com> Date: Wed, 2 Apr 2025 10:45:29 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Performance issues during pg_restore -j with big partitioned table From: Adrian Klaver To: Dimitrios Apostolou , pgsql-general@lists.postgresql.org References: <84379bfb-bbda-84e6-cacc-e863ba9d6c37@gmx.net> <7d3fc27a-1229-4739-8d15-f4005dfa2435@aklaver.com> Content-Language: en-US In-Reply-To: <7d3fc27a-1229-4739-8d15-f4005dfa2435@aklaver.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/2/25 10:39 AM, Adrian Klaver wrote: > > --clean will drop the object entirely not TRUNCATE. > > I'm guessing that this is being done by you per: > > https://www.postgresql.org/message-id/53760c70-4a87-a453-9e02-57abc9cb2e54%40gmx.net > > "After each failed attempt, I need to issue a TRUNCATE table1,table2,... > before I try again. " Oops, forgot to engage brain. From pg_backup_archiver.c: * In parallel restore, if we created the table earlier in * this run (so that we know it is empty) and we are not * restoring a load-via-partition-root data item then we * wrap the COPY in a transaction and precede it with a * TRUNCATE. If wal_level is set to minimal this prevents * WAL-logging the COPY. This obtains a speedup similar * to that from using single_txn mode in non-parallel * restores. * * We mustn't do this for load-via-partition-root cases * because some data might get moved across partition * boundaries, risking deadlock and/or loss of previously * loaded data. (We assume that all partitions of a * partitioned table will be treated the same way.) > >> > >> >> Thanks in advance, >> Dimitris >> >> > -- Adrian Klaver adrian.klaver@aklaver.com