mysql - Which is faster: multiple single INSERTs or one multiple-row INSERT? - Stack Overflow

PHOTO EMBED

Mon Aug 21 2023 20:21:36 GMT+0000 (Coordinated Universal Time)

Saved by @mvieira #sql

$start = microtime(true);
for($i = 0; $i < 3000; $i++)
{
    mysqli_query($res, "insert into app__debuglog VALUE (null,now(), 'msg : $i','callstack','user','debug_speed','vars')");
}
$end = microtime(true);
echo "Took " . ($end - $start) . " s\n";
content_copyCOPY

https://stackoverflow.com/questions/1793169/which-is-faster-multiple-single-inserts-or-one-multiple-row-insert