Which of those 2 models are faster ? and how much faster ? 1) INSERT INTO tbl_name (a,b,c) VALUES(1,2,3); INSERT INTO tbl_name (a,b,c) VALUES(4,5,6); INSERT INTO tbl_name (a,b,c) VALUES(7,8,9); 2) INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9); and how bid multiple query (2) could be in size ?
of course, the 2nd variant also add for even faster LOCK TABLES tbl_name WRITE; INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9); UNLOCK TABLES;
but the thing is , I specially switch to innodb so the table is not going to lock another issue I found out - how I can use : I am using mysql_insert_id(); to get id from single insert, but if I will do multiple insert how does its going to work ?
hmmm good question the only thing which comes in my mind is doing a select SELECT id FROM tbl_name WHERE name IN ('value1','v2','vx')