Re: How to add columns faster
От | Christophe Pettus |
---|---|
Тема | Re: How to add columns faster |
Дата | |
Msg-id | 1C6E9170-65F0-4F16-85E1-97C422699702@thebuild.com обсуждение исходный текст |
Ответ на | Re: How to add columns faster (yudhi s <learnerdatabase99@gmail.com>) |
Ответы |
Re: How to add columns faster
|
Список | pgsql-general |
> On Mar 3, 2024, at 11:40, yudhi s <learnerdatabase99@gmail.com> wrote: > Thanks for the clarification. In case of adding the column as volatile default (like current_timestamp function as default)or say adding NOT NULL column with some conditional population of existing values will be a full table rewrite. Insuch scenarios, the full table rewrite operation is going to take a long time , so what will be the fastest way to achievethat with minimal to no downtime? For other situations, you probably have to create the column as NULL-able, and then backfill it in groups of records untilthe whole column is populated. Remember that dropping the NULL constraint afterwards will require a full table read(although not a rewrite).
В списке pgsql-general по дате отправления: