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 1u2Cb2-00Ebig-Ut for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 17:18:48 +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 1u2Cb1-00Cm4x-3g for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 17:18:47 +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 1u2Cb0-00Cm2P-Nu for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 17:18:47 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u2Caz-003iYu-12 for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 17:18:46 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43ef83a6bfaso2005e9.1 for ; Tue, 08 Apr 2025 10:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1744132723; x=1744737523; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Ct7lB7lEmNFbsfvKn1+8beT3yCrvPTONJPgXSzQ0MDI=; b=y2wUDgfoUZgN94cTYeIZiclGiBIJhRsEt7kZAkD52wd3yH4XZQstDytLM/FWR83R8d o4mAhsVE5eraa8d6oKJyYdIaKViFfK9ICXVbmRLrBM59nQY4wTxxE3Cbw/bBzkK+o0vt MaHHJS4VTX8/XabW5Ja+hmZzs96k5SPtk1cIm+bxj6BqjlYp51ixCHXgB2l18U//Ao87 LsGagGmAnsZjtoA6fK1p+lnimmOKWnmfuQeZN4EA649em3yV75rMaTnU3a4BSMBi59d9 lmjS/vJPRSlC81eUx4VjwEgIEzTr+6zpKugKS02Xzh226hgpKi1o/Proc8CXWMEL2EJa /IpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744132723; x=1744737523; h=content-transfer-encoding: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=Ct7lB7lEmNFbsfvKn1+8beT3yCrvPTONJPgXSzQ0MDI=; b=a6pspzD3JKYvmNMBOgRPUAgC0LwTTQU9j8E6KImKc7x47vmEaeE3O7VYi5aJtSW46K pHMKXxVScY8BeEnlaAUWA6eRYITA5noOGJGem/Vo0KlIXDoG0Da1wksYzVQ0PopzYSuL gD4QN73wrcW+90Z6bw4tl8x2KT5e7yPa6leTsJiz7V7tKdFcQ5nkJk+bfe2DQNXXeGA2 cOLU+zP+5yteZunxdPtWdfqfKUQuEilf3/nIVRxlkcxbi9NfT49dxYpX3zc97O6OXuS7 Q3722Ynz+Jp4kYLvbrPCX5OnsYPlQptb08R/dSh2rTPMhWbpsZS18YK+LTdmdfd0erPd ny+g== X-Forwarded-Encrypted: i=1; AJvYcCWYKgAUcnL7z2mV3kftFUrEfb9I7cZVEkQLL7fUngQZnrKd3V2AcObVGY82zwVPfWwxB/o4V0HigbS5TGQh@lists.postgresql.org X-Gm-Message-State: AOJu0YyyjqpTgtYwiu1EZ6kBEL8/IxRfJJELjmdIUvhgvvdLpsx3ZZeZ EMij7lwpy2g5K0TNkFBU0KSCGArLrsAI9Lz6Zflq5w7uXB3EE4zlpqy/T8hRigQVtJK5oZY/U2I q4KEMP3ylAKZVf1FMYOyOoX1KqYK6n/+2edZD X-Gm-Gg: ASbGnctX2sHBw6cEAhi7rfzmrs6c5kk/vY9FVYDe6GWSQuTuGreOBrwUHeLJcrW7ruq hXYhYR2WJ2aeLqaeWA2bUbSFRejUWZGBpvrMtLKzqRXpc2JVPoR77oRWPuF07ieqoVkThG+0pPE ikxKcQeHGn+glvpuukfNJGIISfaQ== X-Google-Smtp-Source: AGHT+IHlSWE2Fi5ixYIlrWk/WyGhczbwrzuGZQS/5qFjMzis69+EvbdIiCvaNI1jLNkEso9qNmp0fC49hfwZFPgtG5Q= X-Received: by 2002:a05:600c:6d55:b0:43b:bf3f:9664 with SMTP id 5b1f17b1804b1-43f11fd1497mr932975e9.5.1744132722292; Tue, 08 Apr 2025 10:18:42 -0700 (PDT) MIME-Version: 1.0 References: <4044567.1744128814@sss.pgh.pa.us> <4047312.1744130263@sss.pgh.pa.us> <4050387.1744132029@sss.pgh.pa.us> In-Reply-To: <4050387.1744132029@sss.pgh.pa.us> From: Hannu Krosing Date: Tue, 8 Apr 2025 19:18:31 +0200 X-Gm-Features: ATxdqUFfa8NXnz8Nrrw9BlHW38Nq44AbGgeT5ybTzlknFh_Zn0vECSpCX6X3Yi8 Message-ID: Subject: Re: Horribly slow pg_upgrade performance with many Large Objects To: Tom Lane Cc: Nathan Bossart , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 8, 2025 at 7:07=E2=80=AFPM 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. > > 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; Also note that in my --binary-upgrade tests the 100 min / 100M objects ratio was in case with no grants. I would expect this to grow to at least 120 to 150 minutes when grants are also involved. In copy case I would expect the presence of grants to not make much differe= nce. > we'd have > > COPY pg_largeobject_metadata FROM STDIN; > ... > 2121 10 {postgres=3Drw/postgres,joe=3Drw/postgres} > ... -- Hannu