W
W
wawa2018-05-19 13:17:44
PostgreSQL
wawa, 2018-05-19 13:17:44

How to break a long data migration into multiple transactions?

There is a DB where one label occupies a lot of place on a disk.
I added a new column to it.
Now you need to fill it.
Because Since the migration is performed in a transaction and will affect almost all records, it will take a long time and, I assume, the size of the table at the end of the transaction will increase by ~ 2 times (due to MVCC).
That being said, I don't need to perform these changes in a single transaction, but need to perform in a single migration. How to do it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question