Hi Christian
It's certainly worth pursuing - can you please create a new feature
request on the JIRA tracker - http://framework.zend.com/issues/secure/Dashboard.jspa
Kind regards
Hi!
Some time ago I noticed that Zend_DB and especially
Zend_Db_Adapter_Abstract
prepare ANY statement except when you use the following code fragment:
$result = $db->getConnection()->exec('DROP TABLE bugs');
The methodology of preparing each statement is necessary for Oracle
as far
as I remember. Regarding MySQL it has a huge impact on performance
instead!
The one and only time you need to prepare a statement in MySQL is if
you use
the prepared query several times with different values bound to the ?
parameters.
I compared the Zend:DB MySQL adapters to ADO, Pear and Native PHP code
inserting 100.000 rows.
Code looked something like this:
for ($i = 0; $i < 100.000; $i++) {
$data = array(
'text' => 'somedummytext'
);
$db->insert('testtable', $data);
}
Now, the Zend MySQL adapters send 200.000 queries to the mysql
server in
this case, a "prepare & execute" for each call to $db->insert().
This resulted in double execution time compared to native php access
in
other words a performance drop of 100%! Of course, SELECT statements
(fetchRow, fetchAll, etc.) are prepared, too. Just imagine you use
around
100 select queries to render a site - each select will be individually
prepared, although this is completely nonsense in my opinion.
Are there any plans for disabling the "automatic prepare feature" or
any
other hints on this issue?
--
View this message in context:
http://www.nabble.com/Zend_DB-performance-issue-tp14233508s16154p14233508.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
Simon Mundy | Director | PEPTOLAB
""" " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
PeptoLab will be closed:
Saturday 15th December through until Monday 17th December
Saturday 22nd December through until Wednesday 2nd January
For urgent requests, please call 0438 046 061
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654
4124
http://www.peptolab.com