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 1u2CeG-00EcWt-2F for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 17:22:08 +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 1u2CeE-00Cs4v-GF for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 17:22:06 +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 1u2CeE-00Cs4n-6r for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 17:22:06 +0000 Received: from mail-yw1-x1130.google.com ([2607:f8b0:4864:20::1130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u2CeC-004B2j-1M for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 17:22:06 +0000 Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-6ff07872097so53736507b3.3 for ; Tue, 08 Apr 2025 10:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744132923; x=1744737723; 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=UVRF3kh10DVayZpR9VT+mYhz59NwuQ9qvVF1on1p45I=; b=KZpFRnPFhKefCAht6K8dHXyRZ17Akb+I0lMIkvoNTVroD8UJlpNwJgxT6Z9srIOjG8 KxEHd9xabZrCa2frtfQCVCLqwTUQV/ATrHegVPlgTG85ebadJ4GwuKIxyC+OSRwCPXwa yXy/MmDnsESFd0MJa6Pfety+8GQB+KsyCWhdl7iwhkOzvUjTX69EvXUjL4RMgZ61rRHL VK18cHfPFqEEG8xEMI73fouwle5YaJWb81lQ8aDmLx+KsBHgHEnONtUKaJv6B44Op8SY b3AnVYY3ZgXJdoSF97mvz45eQHKuJXIpZwtNomOZaMxyv5B82G9DhCrpKkMhk6g0FhBE 5UZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744132923; x=1744737723; 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=UVRF3kh10DVayZpR9VT+mYhz59NwuQ9qvVF1on1p45I=; b=sBTpr+ALNhDCXWRtTBE9Pxk2BFMNIe47FLLKZzBUVj1fEQk3KZ1nQ6Ffqrq+i3ERhI OgbrC02Qs7XYeOPhFuPW4+395Xe/lte+vBa8RHwLAS5nT/RkD4pmUo7QZA88G6dfZo+p P3UKx39ff8f/ytlguj1jeERnxpqO9XCQoAU3X2Lw8B8KUUu6ANwSCj1e5PczF1KkGF9z bExwC0I10qNhc2Oa3+3dqddVyRITr4+Y7pSFY5IaR7fCd0P0o5qW/0Sg8Vj84lE/AICf hWhue74pHQCLK56WV+k3HOCA+iFgApCbYm0hVGVqwI7FtjlKpgE+D9B5PzfKUglSOodE 2VQw== X-Forwarded-Encrypted: i=1; AJvYcCVFIwtuxK3x/gq7uRo+00gigYkSb8VsDW/GXDoQ399TG8+/OHroLG2kXEOuvwI1BKu9namfn7BnQVinYUhs@lists.postgresql.org X-Gm-Message-State: AOJu0YzATvfE0dusVNAu53sDi7Pay4u48BQC5jHDeUiuL+JT5icpgm0s /K9n3nhcfwqorXMlEDzCYF3frGW0a0Lrv04vlV+B6WHJ/8OfRePf X-Gm-Gg: ASbGnctEPqyVEt4PH6ZjJlXDM5UCbRPFAxc+gDbsEjDVJn3jZkIXD9hKVINcRb6monY HE8ZL7KfYl0vM3MxaiGTzMQx+RY0jxbO57cVvZR1S8XZ+PH+YdDEpa9JF4+hYwFInDPATuvq7Ez AxALs2TZm6T7XSiB/886Q/L/rrsS9GycMwABKOnz1Tta+rcq8Id1gm/XPgpsmm+gVXGyYYYBu2k 9EGLVg7G9gXud38A/83lhPVnPKC8QXejaQwRbxgeVVWtMRO67btWA8z4d9Tn3yk3aPHK94YFBM7 92m85CPqHQPivlpQeX1itidmYYrrUHrQtyPb2qKE762nTyNLnMCS+EbkXCyDNVPkcGub95JRsIZ Xj+M7fJ1PYeKX7mwBDYurS1gA+g2iXOx1h64= X-Google-Smtp-Source: AGHT+IEEISZaQL6xuUTtYSGO+FFwRR67jRORQXgVJ+namjsJy9j9Rws7MVRlEe8Jd2XuYCxf5t7xiQ== X-Received: by 2002:a05:690c:dd3:b0:6f7:55a2:4cd8 with SMTP id 00721157ae682-705387cee3dmr1019857b3.5.1744132923068; Tue, 08 Apr 2025 10:22: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 00721157ae682-703d1f6f3ddsm31702377b3.78.2025.04.08.10.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 10:22:02 -0700 (PDT) Date: Tue, 8 Apr 2025 12:22:00 -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> <4050387.1744132029@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4050387.1744132029@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 01:07:09PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> I do think it's worth considering going back to copying >> pg_largobject_metadata's files for upgrades from v16 and newer. > > (If we do this) I don't see why we'd need to stop at v16. I'm > envisioning that we'd use COPY, which will be dealing in the > text representation of aclitems, and I don't think that's changed > in a long time. The sort of thing that would break it is changes > in the set of available/default privilege bits for large objects. I was thinking of actually reverting commit 12a53c7 for upgrades from v16, which AFAICT is the last release where any relevant storage formats changed (aclitem changed in v16). But if COPY gets us pretty close to that and is less likely to be disrupted by future changes, it could be a better long-term approach. > That is, where the dump currently contains something like > > SELECT pg_catalog.lo_create('2121'); > ALTER LARGE OBJECT 2121 OWNER TO postgres; > GRANT ALL ON LARGE OBJECT 2121 TO joe; > > we'd have > > COPY pg_largeobject_metadata FROM STDIN; > ... > 2121 10 {postgres=rw/postgres,joe=rw/postgres} > ... > > and some appropriate COPY data for pg_shdepend too. Unless I'm missing something, we don't seem to have had any dependency handling before commit 12a53c7. Was that broken before we moved to SQL commands? -- nathan