RE: Disable WAL logging to speed up data loading

From: "osumi(dot)takamichi(at)fujitsu(dot)com" <osumi(dot)takamichi(at)fujitsu(dot)com>
To: 'Amul Sul' <sulamul(at)gmail(dot)com>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: Disable WAL logging to speed up data loading
Date: 2020-09-30 02:33:21
Message-ID: OSBPR01MB4888C85656340960E6164255ED330@OSBPR01MB4888.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Amul

> > We'd like to propose a feature to disable WAL to speed up data loading. This
> was inspired by a feature added in the latest MySQL. I wish you won't fear
> this feature...
> >
>
> TWIMW, pg_bulkload contrib module[1], also does the same for the faster data
> loading.

Both features are helpful to make the data loading faster,
but those are different.

There are at least two major merits as their differences to use wal_level='none'.
The first one happens when user upgrades major version by pg_dumpall.
Imagine a case that one user gets a logical backup of whole cluster by pg_dumpall.
The output file contains many COPY commands in it to recreate and upgrade the cluster.

Setting wal_level='none' can be easily used to boost the speed to remake the
cluster of a newer version by setting the wal_level.
OTOH, pg_bulkload can't treat this flow of upgrade in an easy way.
It requires to plan and write the detail of control files or commands for each table manually.
This wouldn't be easy for users.

Secondly,
to use pg_bulkload requires us to use a wrapper command of pg_ctl
like "pg_bulkload -r", which is prepared only for the feature.
This command is used when pg_bulkload is crashed.
The document recommends not to use pg_ctl directly in such a case.
Like this, paying attention to such usages or minor differences of usage is troublesome
while running a long operation of service, without support of the OSS community.

What did you think ?

Regards,
Takamichi Osumi

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2020-09-30 02:48:25 Re: Use PG_FINALLY to simplify code
Previous Message tsunakawa.takay@fujitsu.com 2020-09-30 02:31:40 RE: BLOB / CLOB support in PostgreSQL