Ask Your Question

How come the query cache isn't read in new sessions?

asked 2013-06-07 12:07:21 -0500

kate_r's avatar

updated 2013-06-07 12:21:59 -0500

Evgeny's avatar


How come the query to count the number of entries in askbot_thread doesn't come from MySQL's query cache in new sessions? It comes from the query cache only if the session already exists in the django_session table, but not when it's not. This is the query for computing paginator.num_pages in the readers.questions() function.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-06-07 12:21:13 -0500

Evgeny's avatar

updated 2013-06-07 12:21:37 -0500

Probably, something is not right in the MySQL configuration.

MySQL handles its query cache internally and this issue is not related with the Askbot code base.

edit flag offensive delete link more


Right, but how is setup? Is the "1,689 questions" on the frontpage read from query cache or memcache? If the setup is like that in the trunk, does the setup require creating any multi columns index separately?

kate_r's avatar kate_r  ( 2013-06-07 12:30:59 -0500 )edit

On this site we use locmem cache and single process. Of course it will not read all the 1K+ questions - it is just the count, delivered by a separate query. Our MySQL setup is default, no optimizations. This site is fairly low traffic so we don't need to optimize. I remember that I've set up MySQL memory cache before - by editing the my.cnf file, but don't recall the details - just have a look at the MySOL docs.

Evgeny's avatar Evgeny  ( 2013-06-07 12:37:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-06-07 12:07:21 -0500

Seen: 171 times

Last updated: Jun 07 '13