SpinTheMic
Pro

Interview practice question

Adding a NOT NULL column to a billion-row table

Backend Engineering · Relational Databases · Experienced

You must add a NOT NULL column with values derived from other data to a billion-row table. How do you do it safely?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Add nullable column first.
  • Backfill in batches.
  • App writes new column for new rows.
  • Validate, then add NOT NULL (NOT VALID check then VALIDATE).
  • Monitor lag and locks.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics