On 02.05.2005 16:41, Marco Colombo wrote:
> Have you measured the real gain in using persistent connections at all?
As simple as possible:
<?php
require_once('Benchmark/Timer.php');
$timer =& new Benchmark_Timer();
$timer->start();
pg_pconnect('host=myhost dbname=database user=user');
pg_query("SET search_path TO myschema;");
$q = "SELECT u.login FROM users WHERE u.user_id = 1;";
$qr = pg_query($q);
print_r(pg_fetch_all($qr));
$timer->setMarker('Database');
$timer->stop();
$timer->display();
?>
Results:
pconnect: 0.001435995101928
connect: 0.016793966293335
It's factor 10 on such simple things on the BSD box.