Hi, Ryan Chan wrote: > I have traced the source code of ZFW, and found the database adapter > Zend_Db_Adapter_Mysqli always do a prepare when execute any SQL. > > However, I found it is not needed, since most of my query only run > once in their life cycle - no reuse is needed. It is possible to > disable auto prepare so it can save a MySQL roundtrip for the prepare > statement?
No. It comes from "Zend_Db_Statement_Mysqli". As you can see in the code you have traced - there is currently no "switch". Please overwrite "Zend_Db_Statement_Mysqli::_prepare()" (just replace the method's body with a statement creation) and benchmark you application. You should notice, that the roundtrip hasn't any measurable impact on the whole application performance: If your application is currently not as fast you want, this won't speed it up ;-) -- Regards, Thomas