From: | Marcos José Setim <mjs_ops(at)gmx(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Performance Low Using the Prepare and Execute |
Date: | 2006-01-07 20:38:54 |
Message-ID: | 1136666335.4440.18.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
I want to use the Prepare and Execute resources of PostgreSQL to
increment the performance of my SQL's.
I do tests using the PHP and ADODB inserting 5000 registers and
counting the time of execution. But the results was pratically
identical.
See below the results:
Time of Execution (ADODB:: Prepare and Execute Manually) : 44.9510087967
Time of Execution (ADODB:: Prepare and Execute of ADODB): 47.6438999176
Time of Execution (ADODB:: Without Prepare): 47.6229438782
Test1 Code:
$sSQL = 'EXECUTE teste(\'teste0...............\')';
for ( $i = 0; $i < $iNTestes; $i++ )
$oDB->execute_query( $sSQL, __LINE__, __FILE__ );
Test2 Code:
$sSQL = 'INSERT INTO teste (nome) VALUES( ? )';
$oDB->Prepare( $sSQL );
for ( $i = 0; $i < $iNTestes; $i++ )
$oDB->ExecutePrepare( Array( 'teste1...............' ), __LINE__, __FILE__ );
Teste3 Code:
$sSQL = 'INSERT INTO teste (nome) VALUES(\'teste2...............\')';
for ( $i = 0; $i < $iNTestes; $i++ )
$bOk = $oDB->execute_query( $sSQL, __LINE__, __FILE__ );
The SQL that they use the Prepare and Execute would have to be lesser
than the others?
Thanks.
--
__________________
Marcos José Setim
mjs_ops(at)gmx(dot)net
http://www.linuxhard.org
From | Date | Subject | |
---|---|---|---|
Next Message | A. Kretschmer | 2006-01-07 20:43:48 | Re: COPY to |
Previous Message | Tom Lane | 2006-01-07 20:25:06 | Re: Oracle DB Worm Code Published |