Re: Implement UNLOGGED clause for COPY FROM

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: Implement UNLOGGED clause for COPY FROM
Дата
Msg-id c7c94dc6-de56-fe87-4328-fc0567f6fee5@oss.nttdata.com
обсуждение исходный текст
Ответ на Implement UNLOGGED clause for COPY FROM  ("osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>)
Ответы RE: Implement UNLOGGED clause for COPY FROM  ("osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>)
Список pgsql-hackers

On 2020/07/09 11:36, osumi.takamichi@fujitsu.com wrote:
> Hello, hackers.
> 
> 
> I've been thinking to suggest
> a peformance-oriented feature for COPY FROM.
> It's UNLOGGED clause, which means data loading skipping WAL generation.

This feature can work safely with wal_level=replica or logical?
Or it can work only with wal_level=minimal? If yes, what is the main
difference between this method and wal_skip_threshold?

> 
> How to make it work is the following.
> 1. Aquire ACCESS EXCLUSIVE mode to lock the target table and its indexes.
> 2. Mark those relations 'unrecoverable' in pg_class/pg_index.
> 3. Issue one WAL to indicate when COPY UNLOGGED is executed.
> 4. Execute the data loading, bypassing WAL generation for data.
> 5. Sync the data to disk by performing checkpoint.

What happens if the server crashes before #5? Since no WAL for
data-loading can be replayed, the target table should be truncated?

Regards,


-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Следующее
От: Dilip Kumar
Дата:
Сообщение: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions