Re: Disable WAL logging to speed up data loading

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: masao(dot)fujii(at)oss(dot)nttdata(dot)com
Cc: osumi(dot)takamichi(at)fujitsu(dot)com, ashutosh(dot)bapat(dot)oss(at)gmail(dot)com, tsunakawa(dot)takay(at)fujitsu(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Disable WAL logging to speed up data loading
Date: 2020-10-01 04:38:41
Message-ID: 20201001.133841.879039809035873298.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 1 Oct 2020 12:58:19 +0900, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote in
> the table needs to be rewriitten. One idea for that is to improve that
> command
> so that it skips the table rewrite if wal_level=minimal.
> Of course, also you can change wal_level after marking the table as
> unlogged.

tablecmd.c:

> * There are two reasons for requiring a rewrite when changing
> * persistence: on one hand, we need to ensure that the buffers
> * belonging to each of the two relations are marked with or without
> * BM_PERMANENT properly. On the other hand, since rewriting creates
> * and assigns a new relfilenode, we automatically create or drop an
> * init fork for the relation as appropriate.

According to this comment, perhaps we can do that at least for
wal_level=minimal.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2020-10-01 04:41:51 Re: Logical replication CPU-bound with TRUNCATE/DROP/CREATE many tables
Previous Message Michael Paquier 2020-10-01 04:37:29 Re: Protect syscache from bloating with negative cache entries