Re: Dropping column from big table

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Dropping column from big table
Дата
Msg-id 202407111305.swxs3no6pmhy@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Dropping column from big table  (Ron Johnson <ronljohnsonjr@gmail.com>)
Список pgsql-general
On 2024-Jul-11, Ron Johnson wrote:

> Anyway, DROP is the easy part; it's ADD COLUMN that can take a lot of time
> (depending on whether or not you populate the column with a default value).

Actually, ADD COLUMN with a default does not rewrite the entire table
either, starting from pg11.

"Major enhancements in PostgreSQL 11 include:
[...]
* Many other useful performance improvements, including the ability to
  avoid a table rewrite for ALTER TABLE ... ADD COLUMN with a non-null
  column default."

https://www.postgresql.org/docs/11/release-11.html

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/



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

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: Dropping column from big table
Следующее
От: Dimitrios Apostolou
Дата:
Сообщение: Re: Query on partitioned table needs memory n_partitions * work_mem