[GENERAL] Speed of conversion from int to bigint

Поиск
Список
Период
Сортировка
От Jonathan Moules
Тема [GENERAL] Speed of conversion from int to bigint
Дата
Msg-id 15ec2604a7d.e9912c3985278.6402582227177025587@lightpear.com
обсуждение исходный текст
Ответы Re: [GENERAL] Speed of conversion from int to bigint  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-general
Hi,
(Postgres 9.5 and 9.6)
We have a table of about 650million rows. It's a partitioned table, with two "child" tables. We want to change its primary key type from int to bigint while retaining the current values.

We're using this:

ALTER TABLE dta.my_table ALTER column table_id TYPE bigint;

But it's taking a very long time, and locking the database. We're going to need to do this in production as well, so a long-term table-lock isn't workable.
Is there anything we can do to speed things up? How long is this likely to take?

Thanks,
Jonathan

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

Предыдущее
От: Thomas Güttler
Дата:
Сообщение: Re: [GENERAL] VM-Ware Backup of VM safe?: snapshots: quiesced andnon-quiesced
Следующее
От: Thomas Güttler
Дата:
Сообщение: Re: [GENERAL] Final pg_dumpall should happen in Single-User-Mode