[development] Variables, lookups, and memory usage

Robert Douglass rob at robshouse.net
Fri Dec 16 12:45:41 UTC 2005


One thing I'm curious about, Allie, is the number of database lookups 
(which loading all variables intends to reduce). How does your module 
handle this? Are all of your lookups done via a centralized function? Or 
do you sometimes do custom queries on the table itself? Or both? How 
many queries are the result?

I once suggested that the variable table should get a "realm" column and 
that variable_get should load and static cache all the variables one 
realm at a time. This was still in the context of "realm" being 
synonymous with "module". Does your module have a strategy for caching 
and reducing db queries? Would there be any use in loading all the 
variables in a realm at once with the thought that the others in the 
same realm would probably be needed, and the subsequent queries should 
be avoided?

-Robert


More information about the development mailing list