Schema migrations on multi-terabyte datasets are operational programs, not single SQL statements.
Safe Sequence
- Shadow table creation.
- Backfill in bounded chunks.
- Enable dual-write.
- Validate checksums continuously.
- Gradual read cutover, then write cutover.
INSERT INTO users_v2 (id, email)
SELECT id, email FROM users
WHERE id > ? AND id <= ?;No cutover without sustained zero drift.