Re: alter table xxx set unlogged take long time

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: alter table xxx set unlogged take long time
Дата
Msg-id 20220728.135659.1851781731419305082.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на RE: alter table xxx set unlogged take long time  ("James Pang (chaolpan)" <chaolpan@cisco.com>)
Список pgsql-performance
At Tue, 26 Jul 2022 12:41:07 +0000, "James Pang (chaolpan)" <chaolpan@cisco.com> wrote in 
> How to make it fast ?  These are our steps about copy large data from Oracle to Postgres
> 
>   1.  Create table in Postgres  2. Extract data from Oracle to CSV  3. Alter table set xxx unlogged,   4. Run copy
commandinto Postgres db  5. Alter table set xxx logged  6. Create index …
 
> Step 5 took long time ,especially for large tables.

As others pointed, the step5 inevitably requires WAL emittion. On the
other hand, there is a proposed patch [1]. It lets ALTER TABLE SET
LOGGED/UNLOGGED evade duping the whole target table and could reduce
the amount of WAL to be emitted (caused by the difference of
tuple-based WAL and per-page WAL) (in major cases).

Could you try it and see if it works for you in any extent?

regards.

[1] https://commitfest.postgresql.org/38/3461/

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Postgresql 14 partitioning advice
Следующее
От: "James Pang (chaolpan)"
Дата:
Сообщение: RE: alter table xxx set unlogged take long time