Re: alter table xxx set unlogged take long time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux