Re: MDB2 query caching
| From: | Alexey Borzov | Date: | Mon, 12 Jan 2009 12:01:13 +0000 |
| Subject: | Re: MDB2 query caching | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-29585@lists.php.net to get a copy of this message | ||
Hi,
Sami Mußbach wrote:
thank you for your replay and for the link. (and sorry to bother you again...). I understood that the query sould be cached and I understand why. But if I test it I receive a different result. If I ask mysql with SHOW STATUS LIKE 'Qcache%' I receive Qcache_not_cached 0. If I perform one simple prepared select-query , I receive Qcache_not_cached 2, but I would expect it to be one as it increments automatically. In addition, I have Qcache_inserts, Qcache_hits and Qcache_queries_in_cache all 0. Cache is activated and works perfectly with mysql_query()-querys. Do I interpret this correctly as the cache is somehow not used? Any Ideas?5 minutes of stumbling through MySQL documentation gave me the following: Before MySQL 5.1.17, prepared statements do not use the query cache. Beginning with 5.1.17, prepared statements use the query cache under certain conditions, which differ depending on the preparation method... http://dev.mysql.com/doc/refman/5.1/en/query-cache-how.html Also please bear in mind: MySQL's query cache is basically a cheap gimmick implemented to a) look better in benchmarks specifically skewed to take advantage of this feature; b) make mostly read-only websites, whose maintainers are too stupid to implement application-level cache, perform faster.