Search Postgresql Archives

Re: How to add columns faster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Mar 3, 2024, at 11:40, yudhi s <learnerdatabase99@xxxxxxxxx> 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. In such scenarios, the full table rewrite operation is going to take a long time , so what will be the fastest way to achieve that 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 until the whole column is populated.  Remember that dropping the NULL constraint afterwards will require a full table read (although not a rewrite).





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux