1 Million Row Insert

+2 Zurrell Loriez · January 30, 2015
Hi guys,

I recently created a loop using php to insert 1 million rows into my database to see how much space it will take up if the columns are filled to capacity. So far I am about 15 minutes into the loop and its only inserted 200,000 rows into the table. Is this a normal speed?

Post a Reply


Oldest  Newest  Rating
+1 Branislav Lazic · February 2, 2015
If you ate recreating your prepared statement each time when you want to insert new record, then you are doing it all wrong. Read about batch insertion.
+1 Kabir Knight · February 1, 2015
Hey Zurrell,

I haven't used PHP to insert any data to SQL, however, I have inserted million plus rows with 10-12 columns many times. Assuming you are inserting one column per row, using a standard personal computer and all entries are strings (nVARCHAR),  200000 rows in ~15 mins sounds normal to me.
  • 1

SQL & Databases


Everything SQL and Databases related in here!

Bucky Roberts Administrator