[drupal-devel] MySQL, large keys

Moshe Weitzman weitzman at tejasa.com
Fri Oct 21 11:41:34 UTC 2005

>>>> David Axmark, co-founder of MySQL had a quick look at Drupal's  
>>>> database scheme and hinted that we should take a look at the  length 
>>>> of our table keys.  He suggested that reducing their size,  might 
>>>> improve performance.  Someone to investigate this, and to  run some 
>>>> benchmarks?

yes, we've been very lazy about this

> I might find time to do some. David also told us that the mysql query 
> cache for a table is emtied when a table changes. That means thet the 
> mysql query cache for the cache table is invalidated very often. 
> Splitting up the cache table into dedicated tables for menu, filter, 
> page, locale, default will therefore make the mysql query cache more 
> efficient. Also, generally selects will be faster.

you are optimizing selects that are already very very fast. these are single 
table queries with a single condition on an indexed column.

i think that further optimizing drupal for the mysql query cache is a more 
involved effort. you have to simplify queries in order to avoid DISTINCT(), 
COUNT(), SUM(), etc. that often means performing subqueries or multiple 
successive queries.

with mysql query cache enabled, i am seeing pages using 50ms of total query 
time. not much to improve upon IMO.

More information about the drupal-devel mailing list