June 29, 2004
Query Result Caching
Query result caching is ideal for querys that don't change often, normally the ideal is to obtain values from a lookup table or when dealing with the next n records.
One can specify caching withing the <CFQUERY> tag via the CACHEDWITHIN and CACHEDAFTER attributes. A side note is that one should use either the cachedwithin or cachedafter not both simultaneously in the same query.
I like using the CACHEDWITHIN attribute and setting the applications query timeout parameter in the application.cfm with a url override if we need to immediately update criteria.
Yesterday Macromedia released a tech note regarding the behavior of cached queries when maximum number is set to 0. Basically setting the value to zero in the administrator causes no upper limit to be set, and all queries with caching indicated are cached. This will eat up all server memory (ram and pagefile). It use to be in CF5 that this value represented the number of queries, I think it now represents the memory size.
So if you use query result caching alot, one probably needs to set the Maximum number of cached queries parameter intelligently. One of the goals is to keep the cached queries in memory (ram) but not on the pagefile. The reason being is that the pagefile will affect response time. Also keep in mind that if the number is set too low then the oldest cached query is just dropped beforehand.
First figure on times of high load. So determine the memory calculation of the record sets (number or rows returned * bytes per row). Add in 1024 just for overhead and wiggle room. Now you have an intelligent number one can play with via the 100 default. Also as new applications are brought online, determine if this parameter needs to be reset or new hardware needs to be purchased. Just another one of those things to add to the proactive monitoring list.
Personally, I never use CACHEDWITHIN - since you can't use that with cfqueryparam. For heavy caching, I prefer storing things in the Application scope.
Finally passed the test
Managing in light of McGregor's Theory X and Theory Y
CMMI
Kicking HIT Leadership Up a Notch
That's just some mumbo jumbo project management BS
Outcomes - The tactic to get to the strategy
Nurse Call, VOIP, and Wi-Fi: Its just cool when things come together!
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
August 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
November 2005
October 2005
September 2005
August 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
Joel on Software
David Ross
Edward Prevost
Martin Fowler
The Health Care Blog
The Tales of Hoffman
The Business Word
Medical Rants
Christina's Considerations
Paul Levy
HIS Talk
Appropriate IT
Candid CIO
RSS feed




