SpinTheMic
Pro

Interview practice question

Importing a million rows quickly

Backend Engineering · Relational Databases · Intermediate

You need to import a CSV with a million rows into a table. Inserting row by row takes hours. How do you speed it up?

What a strong answer covers

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

  • Batch inserts (multi-row).
  • COPY / LOAD DATA bulk commands.
  • Wrap in transactions.
  • Drop/defer indexes during load if possible.
  • Staging table then merge.
Practise this topic

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

See all topics