Hi Berry,

Beegee wrote:
> This is a part from the manual of MySQL: "In MySQL 4.0, the query cache
> is disabled within transactions (it does not return results). Beginning
> with MySQL 4.1.1, the query cache also works within transactions when
> using InnoDB tables (it uses the table version number to detect whether
> its contents are still current)."

For reference, this comes from:
  http://dev.mysql.com/doc/refman/4.1/en/query-cache-how.html

> So, are the following statements correct?
> 1. Apparently all Django generated or MySQLdb generated statements are
> transactional. Even ordinary select statements? Because, only
> transactional statements are not cached. (Still, it is a bit strange
> because the value of Qcache_queries_in_cache does increase over time.)

Django MySQL backend is doing a
   SET autocommit=0
when connecting, and when successful make a COMMIT.

This is regardless of used Storage Engine, working.

SELECT statements which involve InnoDB in transactions will get cached 
in MySQL 4.1 and higher. This has been noted before.

> 2. To be able to use the query cache of MySQL when using MySQL as a
> backend database for Django, you need to use at least version 4.1.1. of
> MySQL. And you need to be using InnoDB tables.

Wrong! Tim already replied, but:
Query Cache is available as of MySQL 4.0, and will also work for SELECT 
statements for InnoDB tables in transactions as of MySQL 4.1.
(Depends on storage engine, MySQL Cluster will not cache in transactions).

You never said, or I missed it, which MySQL server you are running, but 
if you are using MySQL 5.0, you will need to use following statement to 
get the real count for the complete server:
   mysql> SHOW GLOBAL STATUS LIKE 'Qcache\_%';

The GLOBAL keyword is important, as it will default to SESSION, and of 
course that stays zero as you have another session in the MySQL client.

Hope this helps!

Cheers,

Geert

-- 

Geert Vanderkelen
http://www.some-abstract-type-shit.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to