I tried a test.
<?php
function test_emu($lbl, $constr, $usr, $pwd, $emu) {
$con = new PDO($constr, $usr, $pwd);
$con->setAttribute(PDO::ATTR_EMULATE_PREPARES, $emu);
$con->query('CREATE TABLE mik (v INTEGER NOT NULL, PRIMARY KEY(v))');
$t1 = time();
$stmt = $con->prepare('INSERT INTO mik(v) VALUES(:v)');
for($i = 0; $i < 10000; $i++) {
$stmt->execute(array(':v' => $i));
}
$t2 = time();
$con->query('DROP TABLE mik');
echo sprintf('%s (Prepared statement: %s): %d seconds', $lbl, $emu ? 'Emulate in driver' : 'Use database', $t2 - $t1) . "\r\n";
}
function test($lbl, $constr, $usr, $pwd) {
test_emu($lbl, $constr, $usr, $pwd, true);
test_emu($lbl, $constr, $usr, $pwd, false);
}
test('MySQL', 'mysql:host=localhost;dbname=test', 'root', '');
test('SQLServer', 'sqlsrv:server=arnepc4;database=test', '', '');
test('PostgreSQL', 'pgsql:host=localhost;dbname=Test', 'postgres', 'xxxxxx');
?>
Result:
MySQL (Prepared statement: Emulate in driver): 8 seconds
MySQL (Prepared statement: Use database): 8 seconds
SQLServer (Prepared statement: Emulate in driver): 5 seconds
SQLServer (Prepared statement: Use database): 5 seconds
PostgreSQL (Prepared statement: Emulate in driver): 8 seconds
PostgreSQL (Prepared statement: Use database): 7 seconds
No difference.