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 1u2C9p-00EUxt-Ux for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 16:50:41 +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 1u2C9n-00C2Ac-Pb for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 16:50:40 +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 1u2C9G-00Bxr0-4x for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 16:50:06 +0000 Received: from mail-yb1-xb2b.google.com ([2607:f8b0:4864:20::b2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u2C9E-003iFx-1b for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 16:50:05 +0000 Received: by mail-yb1-xb2b.google.com with SMTP id 3f1490d57ef6-e702cffe574so53128276.3 for ; Tue, 08 Apr 2025 09:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744131004; x=1744735804; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=kkjtrA5VvhOBbOBD/q3m7ahY2olfCKM76k3Uw39Vts0=; b=OuHRvbFFn+iy6nqY/7CBgNkVUVAL9D45ovQ+9kICpSYz0YNAMol+vuhOBHVPsEOM60 sRKHRGonFjOp6itsa+ii0N34qNnaRtaxTIPAE41PC+5abAeu7roImqwL0lgNIxtFhQOq 3t2ef1RozTjjF/9qbx4LMGgHJditK89AKCTv3NN8XVrLLinJvIxG8JdtGRkvUhRlROZ7 6QJKuOWe4UVllJ2xCZRfSQKWusGeD05x5Nc1lCP0ZxHGVV5oy0B8xGSAGjjssKTIMUBC OohEhipQ+Vf5JHfjQ1+5M9CIpsDa4LEy+pYCB6A83zEMWUy+tHhAwfp1AHWBMv/pe3Lr tvWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744131004; x=1744735804; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kkjtrA5VvhOBbOBD/q3m7ahY2olfCKM76k3Uw39Vts0=; b=RSFaa4fdV0opUyhh/T1hw6zhz+JSCB5k67ETP5A9jvr0oMkSB9gTpbpJH9ssauJ+no fNjG9hFsFuAbmbwfwgcm07H7J7vcjtcp60k69rkQ2K5CtURdnWDygwDXfCKXkM/Mf35C sbm9gD/v3rxBm2gVBvyN8OTze/8NB1qDan3h79SVbepE8vrTRuj4HNoRPFSuJSuUMZzd AIdq8irz2mN4YQdRWW5HV5LmYh2YCdfVcwDpZ56M7vDIyye+7wjZ0csaqCR8Vz1s/wPl F85zT5uiZftcCA9fcnme46JT43Tw96pYmtXwMfRSgeaiAX5rLxNejTSOWkSbbsXvDSGr PL8w== X-Forwarded-Encrypted: i=1; AJvYcCUfVFdF+DQzaQ03rmJmFCWufjkTNy63x6zhvNy7kyKdjl8dI0fC8xhDBnqbXlnsqZ+yrS+QjcShpmeFqSXF@lists.postgresql.org X-Gm-Message-State: AOJu0YxDnFy9E1EcDqgj84BZoZaddcFv8Zb7MsUsEn1TMLIABx6hvoPR ksF8x53nBvFUewrA9sFOgkA2164mIWR4QmwiV5xeU5JgzKTBrO9FMeV+0A== X-Gm-Gg: ASbGncsHTyUqG+6gRBNABMRMOuRyV/mAmG1OBSna1P1Bg30j3WftauAkRDpljilHJss RdVHnR2k0/1Q1/2heUYsad9Xp0DH/0czdr2DPn4CjgV58PynBCxdjXQ8G4wk5WMlAMOxXqaHYpW xGBsRErACazoDEjGl2zLwC4a8ZVMd0suBiUzHLEZeLkg/u16A5+8TJg7KVH/LRUhBChBGpUiWEg +HM3kOFsDCLBFDhe2Cpf4ojO0sNAOs2aBMsAtWBEVYG+5Th/+IPHsp5vkwMK3wmOcg41dXkPIjV raoiqGRnp7T+g8RKJFQBc6CkL1ZcSmYxIF72M5EFf+aoBb5d/oU6oczy2OLCDhSYHNTvw51h67H a1vsw+4TkTa47pXD1UudqXc4m5elOSz9ClG35lGAI X-Google-Smtp-Source: AGHT+IEOaixCQnZSCx2+xuoweKxpKdBOK3ZIiRl5JqVeY5kUTivEj5+q5LRLKCEVV8GdjcX6UQ8jAg== X-Received: by 2002:a05:6902:490e:b0:e6d:ec5e:b5ee with SMTP id 3f1490d57ef6-e6e318b5d0amr22121310276.30.1744131003643; Tue, 08 Apr 2025 09:50:03 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e6e0ca96611sm2963119276.41.2025.04.08.09.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 09:50:03 -0700 (PDT) Date: Tue, 8 Apr 2025 11:50:01 -0500 From: Nathan Bossart To: Tom Lane Cc: Hannu Krosing , PostgreSQL Hackers Subject: Re: Horribly slow pg_upgrade performance with many Large Objects Message-ID: References: <4044567.1744128814@sss.pgh.pa.us> <4047312.1744130263@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4047312.1744130263@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 08, 2025 at 12:37:43PM -0400, Tom Lane wrote: > Hannu Krosing writes: >> I think we do preserve role oids > > Oh ... I'd been looking for mentions of "role" in > pg_upgrade_support.c, but what I should have looked for was > "pg_authid". So yeah, we do preserve role OIDs, and maybe that's > enough to make this workable, at least with source versions that > share the same rules for what goes into pg_largeobject_metadata and > pg_shdepend. It's not something I'd risk back-patching though. I do think it's worth considering going back to copying pg_largobject_metadata's files for upgrades from v16 and newer. That sounds restrictive at the moment, but it'll mean that all but one supported major version can copy the files during upgrade to v19. I'll admit I'm a tad worried about having to go back to copying via SQL commands in the future and re-regressing things (leading to unpredictable differences in upgrade downtime), but I'm not sure that's a great reason to withhold this optimization. Of course, I wouldn't be opposed to optimizing the SQL command strategy, too, but I suspect that won't compare to copying the files. -- nathan