[development] Caching, caching, caching...

Dries Buytaert dries.buytaert at gmail.com
Sat Jul 22 17:32:58 UTC 2006

On 22 Jul 2006, at 18:52, Moshe Weitzman wrote:

> Dries Buytaert wrote:
>> On 21 Jul 2006, at 15:15, Moshe Weitzman wrote:
>>> i can't think of any reasonable assumptions. to me, the waste is  
>>> not that we have to perform so many queries, but rather that we  
>>> do so on every page view  even though the data rarely changes. to  
>>> address that, one should use mysql query cache or even memcached.
>> A query cache only eliminates part of the overhead.  Most of the  
>> overhead comes from Drupal's database abstraction layer, not from  
>> execution the actual SQL query:
>>   http://buytaert.net/drupal-database-interaction
>> We gain most if we eliminate calls to db_query().  We use a MySQL  
>> query cache on drupal.org, and the one query that retrieves the  
>> URL alias is still to most expensive query (accumulated cost).
> good point. i guess you have looked at opportunities for  
> improvement in db_query() and friends? I suspect that the slowdown  
> is due to regular expressions. I'm not fluent enough to evaluate  
> which are slow, but here is the list of DB functions that contain a  
> regex.
> db_query
> db_query_range
> db_rewrite_sql
> db_escape_table
> db_query_temporary - only used for search i think

My post (http://buytaert.net/drupal-database-interaction) tells you  
_exactly_ what functions to focus on.  Check the figures.  :)

Dries Buytaert  ::  http://www.buytaert.net/

More information about the development mailing list