Databases · Middle · Question 62 of 75
Why can ALTER TABLE on a busy table freeze the whole application?
- 1It disconnects all clients
- 2
ALTER TABLEalways deletes the data - ✓Correct answer: It waits for an exclusive lock; while waiting, it blocks every new query on that table behind it
Explanation
Set lock_timeout in migrations so the change fails fast instead of queuing everyone, and retry later.