Re: alter table xxx set unlogged take long time - Mailing list pgsql-performance

From David G. Johnston
Subject Re: alter table xxx set unlogged take long time
Date
Msg-id CAKFQuwapFJBOdUPs=ZYsVcDiticJ3mDR2NZ2KxrknPoYBO3iaw@mail.gmail.com
Whole thread Raw
In response to RE: alter table xxx set unlogged take long time  ("James Pang (chaolpan)" <chaolpan@cisco.com>)
List pgsql-performance
On Tue, Jul 26, 2022 at 5:45 AM James Pang (chaolpan) <chaolpan@cisco.com> wrote:
Without step 3 ,  copy data take long time.   Use wal_level=minimal can help make COPY load data without logging ?


I believe you are referring to:


Since the final state of your table will be "logged" relying on the above optimization is the correct path, if you enable "logged" at the end, even with wal_level=minimal, you do not benefit from the optimization and thus your data ends up being written to WAL.

Otherwise, it is overall time that matters, it's no use boasting the COPY is fast if you end up spending hours waiting for ALTER TABLE at the end.

David J.

pgsql-performance by date:

Previous
From: "James Pang (chaolpan)"
Date:
Subject: RE: alter table xxx set unlogged take long time
Next
From: Rick Otten
Date:
Subject: Postgresql 14 partitioning advice