Does setting a default value for Alter Table in Postgres make the query significantly slower?
0
votes
1
answer
115
views
We had an incident very recently that caused our service to be unavailable for some minutes.
Here is the liquibase script that led to the incident:
As you can see, the changeset took quite a lot of time. Our team has concluded that the default value set to

null
is the one to blame here. However, it somehow doesn't sit right with me.
When I check the Postgres pages 1 and 2 , I see that setting the values to null is no different than removing the default value altogether. So, I don't see why this default value setting would cause such problems. On a side note, there were 12 million rows in the table.
As in the title, my question is, does setting a default value cause such downtimes?
The application startup:
Started ApplicationKt in 289.989 seconds (process running for 290.727)
Some logs before the liquibase operation:



Asked by leventunver
(119 rep)
Dec 5, 2024, 04:15 PM
Last activity: Dec 6, 2024, 12:04 PM
Last activity: Dec 6, 2024, 12:04 PM