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 1qNpDQ-00645s-73 for pgsql-admin@arkaria.postgresql.org; Mon, 24 Jul 2023 06:38:44 +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 1qNpDO-008BVQ-Ez for pgsql-admin@arkaria.postgresql.org; Mon, 24 Jul 2023 06:38:42 +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 1qNpDO-008BVI-2q for pgsql-admin@lists.postgresql.org; Mon, 24 Jul 2023 06:38:42 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qNpDK-001Sw0-4Y for pgsql-admin@lists.postgresql.org; Mon, 24 Jul 2023 06:38:41 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-31716932093so2694552f8f.3 for ; Sun, 23 Jul 2023 23:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690180718; x=1690785518; h=in-reply-to:disposition-notification-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Y2aKxsQGcy5m7ymnfX/qekrH5rwKMS2/ZuZQnaZES+4=; b=HUVCIeKmXP0BKveUwCMWssR5JugS4w4cXosHAdTm6a4M1o/SSh6ELnCs/5Ia38oNaf mjJOpmP+DA8YXS6XKUX09bQVK0AyGwVBRoivDFt0e6p7te8RMtSbK3FJpI33sdKpklHF fWwnbyVEbPQwv7m2Ok/7GaZn4P35mDTGuj/SrdQht9NvmK4V/E53Bh9nN4ZgcQIh/8Ch m/z1q8v4rKlGawvNG3gxLEr//toyBdBaswjZe8+Db7wVMcZFdI+bMjQeJSwhQLO2oRxF xnhZ5teNC6FstufoJVnBPbzyfqL8DHsEZVfjLc5zUKlpKb9iyvvqCq/knZppQWSw6jXI fDdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690180718; x=1690785518; h=in-reply-to:disposition-notification-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y2aKxsQGcy5m7ymnfX/qekrH5rwKMS2/ZuZQnaZES+4=; b=PAf9VABK9uQRqZ4WQmBdOqCreHvEzasFp4zEV4J4NpxzGIshtzQVLwwJy+lGFP5VHD OuOzg5g6qUYFiML/97rv07rT6ky5pYeCwD4i/osAq0LXyteFo09+p9WU7Kl4Y0lic1bh BCaQ2v2aU4iM4NvisD4DaX0dcUOL3MpnYLh5mtlIrcVzNQ2KihgOwcVUlNg4iZfnsxby Qg7HC66Ituy2yCrjMfohFZ465GozRsOKhMobHgMX7DK3l/y60svJTWR9wG7ascyoN/MZ fL96dul0IMw0Ho+lxgQ7zj+M9/lip99AJ9kqGvuY2QJYRzJXJRMXEomFHfgBLhItRR7m eBqQ== X-Gm-Message-State: ABy/qLZCan2XYfgOv1h+b+fBfhQ9Z8CRhs+sQQ/aEUTmkQ5P3AgSihvK WoGUrRPXdP44FJN7YKwmRACZfxHUWKw= X-Google-Smtp-Source: APBJJlEETNMwKZ3bgpVCBFgA3uVFxzV/Oeb1haQ5ZgRh/rT8fCUNya7SSJu1ajjwnKe9icQ3YjmqGg== X-Received: by 2002:a5d:5591:0:b0:313:f0d7:a46 with SMTP id i17-20020a5d5591000000b00313f0d70a46mr5415932wrv.3.1690180717344; Sun, 23 Jul 2023 23:38:37 -0700 (PDT) Received: from [10.1.1.193] (94-224-49-27.access.telenet.be. [94.224.49.27]) by smtp.gmail.com with ESMTPSA id m24-20020a056000181800b003143ac73fd0sm11824007wrh.1.2023.07.23.23.38.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 23 Jul 2023 23:38:37 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------x0na9MWCx6LXV9Npi4JhaHPW" Message-ID: Date: Mon, 24 Jul 2023 08:38:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Upgrade from PG12 to PG Content-Language: nl, en-US, fr To: Scott Ribe Cc: pgsql-admin@lists.postgresql.org References: <3901e0da-819b-5b6d-bb57-c29f6d384725@gmail.com> <1cb1652e-286a-077e-950d-516970ecf499@gmail.com> From: Jef Mortelle Disposition-Notification-To: Jef Mortelle In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------x0na9MWCx6LXV9Npi4JhaHPW Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 20/07/2023 20:34, Scott Ribe wrote: >> On Jul 20, 2023, at 11:05 AM, Jef Mortelle wrote: >> >> so, yes pg_ugrade start a pg_dump session, > Only for the schema, which you can see in the output you posted. => the pg_restore of this pg_dump takes about 7 hours ... which is 99% used for executing the query like:  SELECT pg_catalog.lo_unlink('oid'); > > Good to know, but it would be weird to have millions of large objects in a 1TB database. (Then again, I found an old post about 3M large objects taking 5.5GB...) > > Try: > time a run of that pg_dump command, then time a run of pg_restore of the schema only dump => pg_dump schema_only, after RAM upgrade from 8GB up to 64GB (otherwise the query against pg_largeobject ends in a OUT of Memory error) runs in about 3-4 minutes => pg_restore takes 7 hours, which is 99% used for executing the query like:  SELECT pg_catalog.lo_unlink('oid'); > use the link option on pg_upgrade I used the link option in al my tests, and it takes the times For some reason Postgres creates a new subdirectory for each PG version (I make use of tablespaces for each database in my PG cluster), also with using the link option. So after some upgrade,  it ends in a really mess with directory's? > > Searching on this subject turns up some posts about slow restore of large objects under much older versions of PG--not sure if any of it still applies. > > Finally given the earlier confusion between text and large objects, your apparent belief that text columns correlated to large objects, and that text could hold more data than varchar, it's worth asking: do you actually need large objects at all? (Is this even under your control?) The use of OID (large objects): it depends on the vendor of the software. I can ask the vendor to change to another type .... but honestly I don't believe it will changed in the near feature. Database is 95GB, so not so big ;-) but have ~25miljon large objects in it. --------------x0na9MWCx6LXV9Npi4JhaHPW Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 20/07/2023 20:34, Scott Ribe wrote:
On Jul 20, 2023, at 11:05 AM, Jef Mortelle <jefmortelle@gmail.com> wrote:

so, yes pg_ugrade start a pg_dump session,
Only for the schema, which you can see in the output you posted.

=> the pg_restore of this pg_dump takes about 7 hours ... which is 99% used for executing the query like:  SELECT pg_catalog.lo_unlink('oid');


Good to know, but it would be weird to have millions of large objects in a 1TB database. (Then again, I found an old post about 3M large objects taking 5.5GB...)

Try:
  time a run of that pg_dump command, then time a run of pg_restore of the schema only dump
=> pg_dump schema_only, after RAM upgrade from 8GB up to 64GB (otherwise the query against pg_largeobject ends in a OUT of Memory error) runs in about 3-4 minutes
=> pg_restore takes 7 hours, which is 99% used for executing the query like:  SELECT pg_catalog.lo_unlink('oid');
  use the link option on pg_upgrade
I used the link option in al my tests, and it takes the times

For some reason Postgres creates a new subdirectory for each PG version (I make use of tablespaces for each database in my PG cluster), also with using the link option.
So after some upgrade,  it ends in a really mess with directory's?

Searching on this subject turns up some posts about slow restore of large objects under much older versions of PG--not sure if any of it still applies.

Finally given the earlier confusion between text and large objects, your apparent belief that text columns correlated to large objects, and that text could hold more data than varchar, it's worth asking: do you actually need large objects at all? (Is this even under your control?)
The use of OID (large objects): it depends on the vendor of the software. I can ask the vendor to change to another type .... but honestly I don't believe it will changed in the near feature.
Database is 95GB, so not so big ;-) but have ~25miljon large objects in it.
--------------x0na9MWCx6LXV9Npi4JhaHPW--