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.96) (envelope-from ) id 1vo5zq-00FPoT-0g for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Feb 2026 20:30:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vo5zn-000pgE-2q for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Feb 2026 20:30:35 +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.96) (envelope-from ) id 1vo5zn-000pg6-1s for pgsql-hackers@lists.postgresql.org; Thu, 05 Feb 2026 20:30:35 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vo5zk-00000001FER-42ML for pgsql-hackers@lists.postgresql.org; Thu, 05 Feb 2026 20:30:34 +0000 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-7d122733808so134a34.2 for ; Thu, 05 Feb 2026 12:30:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770323431; x=1770928231; 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=pXIxMu9m9oBPNCI/I/3/gGggidbPZDq8luxYPbb8fEY=; b=DZICjUZ34V2MRD1YEgOcqXQjC5yfV8ZM5jAjaxPEkbgnv0juVKdPLHdZMbiLzVhItb QmYBRb+fMhYeVqz9RmCLIU5Ji+pZz3/W3OVVTMy9BndN2FGg1802WlJnH7BgEkZOO19q 0Kj7rUdqGIsfnJ+vEdqe049MofzlmynNjOk4sFzUj9YJTJuWp9mo94RDCkG5/vN7XK/5 yT38miOQV2vXOu+s7yLFRqI3eU8irGJHt5QOem9Ak8zEvYYhJr3kdOLBmz3/rbM1DjlM knyQ5McrUcIX+rcAU5qz9fQ4bfJ7f4lazQS8MAfJbC/I4sh6uMND7eY3verr+/QbgSS6 VA+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770323431; x=1770928231; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pXIxMu9m9oBPNCI/I/3/gGggidbPZDq8luxYPbb8fEY=; b=GR5hUUe0B5JmNHZDggIe+KRGnDr71dNhHhhpqLOSTiRCFoErJ/yxrRit7OAiThSii4 1ZmPTcBXl8XqtAH+0f4MDmYL7KBEf17P5cjWSWGlOnZYlDg1SiSYbH3ObwF+jGjVol4D ysLLTHblqxfmnslfMcqeKL08DiMLY8LMOBqsAwr+N0Of2kGHt0mYtevfpBmGQzwOL7zo 4+WomkKwNueLntq/NYAzUJB67Qqfc3em3MuRb5hzPP8e3PUBYxt9pmzOAxJHvQe2Vwrd OTKK7beeAMSCxk7cgGYMwXpITk/eS5KluLLa5JwtljjTXAoPpY+ThnuSDUY3RUVuWOsh 9qVQ== X-Forwarded-Encrypted: i=1; AJvYcCXeQrs6SOfJBcrb1mNQ52LJijTW5IOQziUoyqs2jdOIKXCNNDmwLb/YYWr2w7157A9FhdCy1ukzU1xUO/M9@lists.postgresql.org X-Gm-Message-State: AOJu0YwnHLzvY5R6UfJQl2eGKtHXd+SNLNQQ6IEsIrbYrg+Ou/WUo5P1 p+zZELI5HHmrMbwxjdZY5m5e33pNrtKyuN1rvIcKpVznkcEuvkwyYSwL X-Gm-Gg: AZuq6aIW38M3XBEE5ZbPmlV2RSSe0QF7yOEpLU4MItPrZxWN1BmO20/JWYz2Fzf4z/X 7a3uWKvvsgIkzh6goI8c1+ZPdG3En4dZdu3dx8edmvgTgTgEE64B9arx/dC34eroxOQ7HgcLp6L ylr5JjpFQI6DATuDBzjuUlMVM8GTP7giktM6SYCDdv8wb6x3dGRyFefbX66aaHs931QS7/DZXKq 0CsndJsGaalcbrT5QvR1geoOwRA1yQQJ1mrLNqQi6EyVa0lFEgpbM4+s2cpyeIqGr5BQD3vEqh5 3o7PgipSNxricIFbF+PmvF1soNlg6Q/9dElPsyS2dUGzr/Bi6VQUfPEJPiGpuYjDAzheOFa2tHQ TDhG8T0V9Se0PpEmqW3TQS0M7OX7jGhnsRQvu+PVpK7/i1XtFXID4ndNvB7pviB8OwMlZj/sqHC icWzC8gRQxkTit29s8ie2Nl2EPj9KD2eQ67p2BSqOXIhNH93298EYzbjfX4fD8zh+dwFUyJJg0H M/aw399qmj8sq4= X-Received: by 2002:a05:6830:d81:b0:7d1:a028:4464 with SMTP id 46e09a7af769-7d4646b2fd7mr107931a34.36.1770323430837; Thu, 05 Feb 2026 12:30:30 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7d464457a98sm142901a34.0.2026.02.05.12.30.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 12:30:30 -0800 (PST) Date: Thu, 5 Feb 2026 14:30:28 -0600 From: Nathan Bossart To: Andres Freund Cc: Michael Paquier , Tom Lane , Nitin Motiani , Hannu Krosing , PostgreSQL Hackers Subject: Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible Message-ID: References: <3yd2ss6n7xywo6pmhd7jjh3bqwgvx35bflzgv3ag4cnzfkik7m@hiyadppqxx6w> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Feb 05, 2026 at 03:23:38PM -0500, Andres Freund wrote: > On 2026-02-05 13:31:23 -0600, Nathan Bossart wrote: >> On Thu, Feb 05, 2026 at 01:02:17PM -0500, Andres Freund wrote: >> > Upthread I also wondering why we do all the work in getLOs() if we don't >> > actually need most of it (only if there are comments or labels). Right now >> > that's a very slow and very memory intensive part of doing an upgrade of a >> > system with a lot of binary upgrades. Do we need *any* of that if we go the >> > path you suggest? >> >> AFAICT we only need it for the comments and security labels later on. > > And in binary upgrade mode not even for that, if we do the thing we talked > about re not checking references in binary upgrade mode? Right? Well, we need _something_ to do what dumpLO() does today, i.e., call dumpComment() and dumpSecLabel() for each large object that has one or the other. I'm sure we could decouple that from the getLOs() machinery if we tried hard enough, but I'm not seeing any great advantage in doing so if we teach getLOs() to only get what it needs. >> In theory, we could update the pg_largeobject_metadata query to only >> retrieve LOs with comments and security labels. I'm not sure it's worth >> trying to optimize further than that; we've long operated under the >> assumption that comments/seclabels on LOs are pretty rare. > > I think that'd be a huge improvement. Right now it's not hard to get into a > situation where you have too many LOs to not have enough memory to do a > pg_upgrade. It seems to work. I'm working on a nicer patch for all this stuff. -- nathan