On Jun 8, 2010, at 8:11 AM, Thomas D. wrote:
Ryan Chan wrote:
After reading the article, I think 'Query cache does not work" is a
strong enough reason not to use prepare statement.
@Ryan:
You need to understand, which prepared statements cannot utilize the
query
cache.
At the time that blog was written (2006-08-02), the GA release of
MySQL was 5.0.24. In that release, the query cache would not benefit
*any* prepared statement.
MySQL 5.1.17 added some more intelligence so prepared statements could
benefit from the query cache under compatible conditions, described
here: http://dev.mysql.com/doc/refman/5.1/en/query-cache-operation.html
Also, some queries can never use the query cache regardless of whether
you use prepared statements or whether you execute the query
directly. E.g. if it contains references to functions or user
variables that might change the result set on successive executions.
Regards,
Bill Karwin