MySQLTalk.com

Enabling MySQL Query Cache with Zend Framework through PDO::MYSQL_ATTR_USE_BUFFERED_QUERY

November 9, 2008 · 2 Comments

It’s interesting that if you read through the Zend dB manual, they mention a big problem with Zend Framework, namely that since Zend uses prepared statements, if you’re running a pre-5.1.17 version of MySQL, you give up the benefits of MySQL’s query cache. They also provide the solution in one of their examples, but they neglect to tell you that it solves the problem.

If you look at example 11.7:

$pdoParams = array(
    PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true
);

you will find setting this parameter when starting the connection turns on the query cache.

Categories: MySQL · Zend
Tagged: , , ,

2 responses so far ↓

Leave a Comment