Re: alter table xxx set unlogged take long time

From: Joe Conway <mail(at)joeconway(dot)com>
To: "James Pang (chaolpan)" <chaolpan(at)cisco(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jim Mlodgenski <jimmy76(at)gmail(dot)com>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: alter table xxx set unlogged take long time
Date: 2022-07-28 12:21:54
Message-ID: 5482d675-5843-271d-cc3c-9df742249baf@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 7/28/22 03:47, James Pang (chaolpan) wrote:
> Does "wal_level=minimal" help reducing wal emitting a lot for COPY
> and CREATE INDEX? We plan to remove "set unlogged/log" , instead ,
> just set "wal_level=minimal" ,then COPY data in parallel, then create
> index.

(Note - please don't top post on these lists)

Yes, wal_level = minimal is a big help in my experience if you can
tolerate it.

Similarly synchronous_commit = off might help as long as you are
prepared to reload some data in the event of a crash (which generally is
true when bulk loading). As noted in the docs:

This parameter can be changed at any time; the
behavior for any one transaction is determined by
the setting in effect when it commits. It is
therefore possible, and useful, to have some
transactions commit synchronously and others
asynchronously.

--
Joe Conway
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Rick Otten 2022-07-29 21:44:11 Re: Postgresql 14 partitioning advice
Previous Message James Pang (chaolpan) 2022-07-28 07:47:56 RE: alter table xxx set unlogged take long time