I just experience exactly the same thing. I am also on
Debian, MySql version 4.0.24_Debian-10sarge1-log. And using
MySQLdb.version_info = (1, 2, 1, 'gamma', 2).
I am actually using MySQLdb via a Python web framework
called Django (www.djangoproject.com). And a lot queries
seem to get cached, because the number
Qcache_queries_in_cache is increasing. But, the number of
cache hits stays zero! However when I execute a query
several times on the MySQL command line the number of cache
hits actually do increase.
"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)."
So your problem would appear to be due to using 4.0.x. I'd
recommend trying with 4.1 or 5.0. I am still pretty certain
this is not a MySQLdb issue.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So I did a test and installed
mysql-standard-5.0.20-linux-x86_64-glibc23. Created a
completely new database and restored a dump from my 'old'
database. Then I had to adjust the query_cache_size.
Now when I browse my website the number of Qcache_hits does
increase! Great!
So, it appears that using MySQL 5.0 does solve my issue.
Thanks very much for your help. Here and on the Django Users
usenet group.
Berry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So I did a test and installed
mysql-standard-5.0.20-linux-x86_64-glibc23. Created a
completely new database and restored a dump from my 'old'
database. Then I had to adjust the query_cache_size.
Now when I browse my website the number of Qcache_hits does
increase! Great!
So, it appears that using MySQL 5.0 does solve my issue.
Thanks very much for your help. Here and on the Django Users
usenet group.
Berry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=71372
You've provided no evidence to support this position.
Logged In: NO
I just experience exactly the same thing. I am also on
Debian, MySql version 4.0.24_Debian-10sarge1-log. And using
MySQLdb.version_info = (1, 2, 1, 'gamma', 2).
I am actually using MySQLdb via a Python web framework
called Django (www.djangoproject.com). And a lot queries
seem to get cached, because the number
Qcache_queries_in_cache is increasing. But, the number of
cache hits stays zero! However when I execute a query
several times on the MySQL command line the number of cache
hits actually do increase.
See also:
http://groups.google.nl/group/django-users/browse_thread/thread/7f4e3e44b2b311e4/c8c313bb122107a7#c8c313bb122107a7
Logged In: YES
user_id=71372
If you can write a test case that demonstrates this, I'll
try to fix it in 1.3. Your test case should print the result of:
SELECT query_cache_type
But I think this is your problem:
http://dev.mysql.com/doc/refman/4.1/en/query-cache-how.html
"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)."
So your problem would appear to be due to using 4.0.x. I'd
recommend trying with 4.1 or 5.0. I am still pretty certain
this is not a MySQLdb issue.
Logged In: NO
See also:
http://groups.google.com/group/django-users/tree/browse_frm/thread/7f4e3e44b2b311e4/859af3ca93af78b6?rnum=11&hl=nl&_done=%2Fgroup%2Fdjango-users%2Fbrowse_frm%2Fthread%2F7f4e3e44b2b311e4%2F6ea0c30017507e18%3Ftvc%3D1%26hl%3Dnl%26#doc_fe40b09d61725354
So I did a test and installed
mysql-standard-5.0.20-linux-x86_64-glibc23. Created a
completely new database and restored a dump from my 'old'
database. Then I had to adjust the query_cache_size.
Now when I browse my website the number of Qcache_hits does
increase! Great!
So, it appears that using MySQL 5.0 does solve my issue.
Thanks very much for your help. Here and on the Django Users
usenet group.
Berry
Logged In: NO
See also:
http://groups.google.com/group/django-users/tree/browse_frm/thread/7f4e3e44b2b311e4/859af3ca93af78b6?rnum=11&hl=nl&_done=%2Fgroup%2Fdjango-users%2Fbrowse_frm%2Fthread%2F7f4e3e44b2b311e4%2F6ea0c30017507e18%3Ftvc%3D1%26hl%3Dnl%26#doc_fe40b09d61725354
So I did a test and installed
mysql-standard-5.0.20-linux-x86_64-glibc23. Created a
completely new database and restored a dump from my 'old'
database. Then I had to adjust the query_cache_size.
Now when I browse my website the number of Qcache_hits does
increase! Great!
So, it appears that using MySQL 5.0 does solve my issue.
Thanks very much for your help. Here and on the Django Users
usenet group.
Berry