All Questions
Scaling Writes medium

You need to import 1 million rows into a SQL database. Which method is fastest?

  1. A Using an ORM loop.
  2. B Sending 1 million individual INSERT statements.
  3. C Using a dedicated bulk load command (like `COPY` in Postgres or `LOAD DATA` in MySQL) to stream the CSV directly.
  4. D Inserting into a temporary table first.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions