Turtle slow bind variables are 6 times slower in Oracle?

From: Date: Sat, 16 Mar 2002 06:56:08 +0000
Subject: Turtle slow bind variables are 6 times slower in Oracle?
Groups: php.db 
Request: Send a blank email to php-db+get-17706@lists.php.net to get a copy of this message
Hello, I recently benchmarked using bind variables for inserts versus sending simple sql over to oracle 8.1.7. Surprisingly, sending simple sql was nearly 6 times faster. My database is using cursor_sharing=force. Can anyone else verify this? >>>>>>> Not using bind variables (MySQL and Oracle), using ADOdb library: $DB->BeginTrans(); for ($i=0; $i < $NUMRECS; $i++) { $DB->Execute( "insert into test5000 (name,price,stock) values ('a name $i',$i,$i)"); } $DB->CommitTrans(); >>>>>>>>>> Using bind variables: $DB->BeginTrans(); $a = ''; $b = 0; $c = 0; $stmt = OCIParse($DB->_connectionID, "insert into test5000 (name,price,stock) values (:a,:b,:c)"); OCIBindByName($stmt,":a",&$a,32); OCIBindByName($stmt,":b",&$b,32); OCIBindByName($stmt,":c",&$c,32); for ($i=0; $i < $NUMRECS; $i++) { $a = "a name $i"; $b = $i; $c = $i; $e = OCIExecute($stmt); if (!$e) { print $DB->ErrorMsg(); break; } } $DB->CommitTrans(); --- For more details, see: http://php.weblogs.com/oracle_mysql_performance

« previous php.db (#17706) next »