Re: Upgrade from PG12 to PG

From: Jef Mortelle <jefmortelle(at)gmail(dot)com>
To: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Upgrade from PG12 to PG
Date: 2023-07-24 06:38:36
Message-ID: e2f6c1e6-d7fd-f7dc-7656-46c6bfc7bf0f@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


On 20/07/2023 20:34, Scott Ribe wrote:
>> On Jul 20, 2023, at 11:05 AM, Jef Mortelle<jefmortelle(at)gmail(dot)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.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Dan Smith 2023-07-24 12:42:23 Re: Is a PS - MSSQL Logical Replication Possible??
Previous Message Erik Serrano 2023-07-24 02:29:49 Is a PS - MSSQL Logical Replication Possible??