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 1uNBvz-00DvrG-Ik for pgsql-performance@arkaria.postgresql.org; Thu, 05 Jun 2025 14:51:11 +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 1uNBvx-00A9nF-Ez for pgsql-performance@arkaria.postgresql.org; Thu, 05 Jun 2025 14:51:10 +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 1uNBvx-00A9l0-4w for pgsql-performance@lists.postgresql.org; Thu, 05 Jun 2025 14:51:09 +0000 Received: from mail1.dalibo.net ([51.159.93.128] helo=mail.dalibo.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uNBvv-000NMc-33 for pgsql-performance@lists.postgresql.org; Thu, 05 Jun 2025 14:51:09 +0000 Received: from [192.168.0.7] (5-49-10-71.hfc.dyn.abo.bbox.fr [5.49.10.71]) by mail.dalibo.com (Postfix) with ESMTPSA id 0E1F427A68; Thu, 5 Jun 2025 16:51:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1749135066; bh=SlpDr8c8Iz95xvrGzcGvysvqgVGPnBkwFSomFenjS7A=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=cPLMPu/m2Pc0l7SY8sCPvNn/Lj8e+LNCPxUswP0oq7wfrFfezAvByLYwoB/aUuVxA /OompXjfjpqFXHnS/exrs2OgRIanhNaBKnYUDpjdHFySPtXXWumG32F26QfQkqmofA WmtNQNQvisVwsR3RAAzYGS8/j1pbvfTNtYwXJ6IY= Message-ID: <437f45aa-b6ea-44bc-8dc3-26cfb309be29@dalibo.com> Date: Thu, 5 Jun 2025 16:51:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: ALTER TABLE ADD FOREIGN KEY to partitioned table, is not parallelized From: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Yhuel?= To: Dimitrios Apostolou Cc: pgsql-performance@lists.postgresql.org, bruce@momjian.us, Christophe Courtois References: <5f002654-92e9-8032-3e1a-134461b4e819@gmx.net> <90e55c6b-3d79-4bf8-8874-a64dd10a0286@dalibo.com> Content-Language: fr, en-US Autocrypt: addr=frederic.yhuel@dalibo.com; keydata= xjMEXn3bgxYJKwYBBAHaRw8BAQdA6tX5FT/n5ztMWIoBdl6k5avvu65fv6ryfVzIx/aH3V3N JEYuIFlodWVsIDxmcmVkZXJpYy55aHVlbEBkYWxpYm8uY29tPsKWBBMWCAA+FiEEi7OTyf6H ePS+C6n11XGWhN8zGNUFAmZDVJ8CGwMFCQtfi90FCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA CgkQ1XGWhN8zGNV65gEA6o+UrebFjn2CIAOYwP3CiiJugiM5TMH9yJyehQua5ZoA/2ChxiVn 8OUaAw/ErxJmQi1mSN0tNZBL/KhkUPBDUDQNzjgEXn3bgxIKKwYBBAGXVQEFAQEHQCuh5cLQ AtEBXHa2Fmtp0kduBu7msM7qO/gaEcdjFUdiAwEIB8J+BBgWCAAmAhsMFiEEi7OTyf6HePS+ C6n11XGWhN8zGNUFAmZDVJ8FCQtfi90ACgkQ1XGWhN8zGNWOOAEArSqePBqfd4Kx4ulACaWO 6fM+XSDfUlBAQXx9rU6DR4MBALwozl9g91tRysim6lKxggvBfp/PvbpTZNrxYLWB2fYP In-Reply-To: <90e55c6b-3d79-4bf8-8874-a64dd10a0286@dalibo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/5/25 16:13, Frédéric Yhuel wrote: > > > On 6/4/25 16:12, Dimitrios Apostolou wrote: >> In general I have noticed most operations are slower after a succesful >> pg_restore until VACUUM is complete, which is unfortunate as the >> database is huge and it takes days to run. Something I have on my list >> to try, is whether a COPY FREEZE would alleviate all this trouble, >> since all tuples are immediately visible then. Maybe a patch for a new >> pg_restore option --freeze is a better solution. Are my assumptions >> right? > > It seems that the idea has already been discussed: https:// > www.postgresql.org/message-id/flat/ > CA%2BU5nM%2BXvkUu9ran%2B5cY%3DTWQquLTpvzte4KVMK%3DaDfbr- > xfNXA%40mail.gmail.com#b61a7fee06e10e61afa68712bc0b3c5b > > I've CCed Bruce Mojman, in the hope that he can tell us more about it. > > (It might be more interesting now than 12 years ago thanks to this patch: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=7db0cd2145f2bce84cac92402e205e4d2b045bf2)