i need to insert 1000-30000 lines at a time (made of 19 elements each) into a mysql table from php using pdo prepared statements. I was asking myself if it would be better to do many different inserts or one big multi insert, like:
INSERT INTO table (a,b,c,...) VALUES (value0a, value0b, value0c,...), (value1a, value1b, value1c,...), ..., (value10000a, value10000b, value10000c,...)
VS exec each insert inside a transaction
INSERT INTO table (a,b,c,...) VALUES (value0a, value0b, value0c,...);
INSERT INTO table (a,b,c,...) VALUES (value1a, value1b, value1c,...);
INSERT INTO table (a,b,c,...) VALUES (value2a, value2b, value2c,...);
...
INSERT INTO table (a,b,c,...) VALUES (value10000a, value10000b, value10000c,...);
looks like a multi-insert is better, so do i have to know how many lines i need to insert and create a (?,?,?,...) placeholders for them and then bind them in a loop? considering that PDOStatement::debugDumpParams() is not showing params values, how do i echo the whole query as it will be inserted?