Re: MDB2 query caching
| From: | Alexey Borzov | Date: | Mon, 12 Jan 2009 13:11:47 +0000 |
| Subject: | Re: MDB2 query caching | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-29586@lists.php.net to get a copy of this message | ||
Hi,
Please reply to the list...
Sami Mußbach wrote:
so I was right that using MDB2 with mysql < 5.1.17 (or better 5.1.21 as only since then prepare and execute-Statements with an ? wont be cached) will lead to significant decrease in performance since mysql-cache is not used.Exactly. So you can't use prepared statements with query cache if your MySQL is below 5.1.21, that's a MySQL shortcoming. You do understand that MySQL has shortcomings too, not only MDB2?..
Even more, with MDB2 with mysql < 5.1.17 I have for every mysql_query() query now 4 + Number of Parameters queries which tightens the bottleneck database quite badly.::shrugs:: Upgrade to MySQL 5.1, they call that "stable" now.
Are there any plans to use the new mysql-functions for prepared statements?Dunno, I use neither MySQL nor MDB2. But 2 minutes of searching at PEAR website led me here: http://pear.php.net/package/MDB2_Driver_mysqli/
@alexey thanks for your sweets about application-caches. Did I say that it's the only cache to use?No, you didn't, but that comment was mostly done for the sake of others who may be searching for the answer in the archives.
I like MDB2 anyhow, don't worry ;-)No one cares.
Sami Mußbach wrote:......................................................... Sami Mußbach Leuphana Universität Lüneburg Rechen- und Medienzentrum Raum C 7.213 Tel.: 04131-677-1271 Fax: 04131-677-1246thank 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. -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php