Sample Header Ad - 728x90

will null-ing JSONB column in postgres table before performing ALTER TABLE DROP of that column help?

1 vote
1 answer
291 views
I changed table structure and I am about to remove old JSONB column from about 2.5M rows big table. The JSONB makes this table really big - pg_total_relation_size: 408GB Performing ALTER TABLE ... DROP COLUMN ..; was so heavy that it blocked whole db and caused 502 in most of the services. QUESTION: if I set that JSONB column NULL before performing ALTER TABLE DROP COLUMN will it go faster? Or is there any other option excluding the one with coping all the collumns except the one have aimed for droping into seperate table and swapping names afterwards?
Asked by andilabs (697 rep)
Feb 8, 2024, 05:31 PM
Last activity: Feb 8, 2024, 05:55 PM