<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="country-region"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:windowtext'>Thanks Mark. After some more
discussion we agree that the best way to achieve our goal of never caching a
dimension would not fall in line with 10788 because, as you pointed out, </span></font><font
color=black><span style='color:windowtext'>10788 is intended to minimize
dimension table reads, not force them</span></font><font size=2 color=black
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'>.
Our current thought is that we can implement a new method in the CacheControl
API that takes a hierarchy, gets a MemberCacheHelper and calls
MemberCacheHelper.flush() to flush the appropriate hierarchy. Does this
sound like a valid solution? <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:windowtext'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:windowtext'>Thanks,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:windowtext'>Mike<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 color=black face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:windowtext;font-weight:bold'>From:</span></font></b><font
size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
color:windowtext'> Marc Berkowitz [mailto:marcb52@speakeasy.net] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Saturday, August 09, 2008
12:25 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Mondrian developer mailing
list<br>
<b><span style='font-weight:bold'>Cc:</span></b> Pflug, Michael (TH <st1:country-region
w:st="on"><st1:place w:st="on">USA</st1:place></st1:country-region>)<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Mondrian] Dimension
member caching</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'>(I wrote this code -- and am still fixing it -- so
I'll try to answer these questions.)<br>
<br>
<a href="mailto:michael.pflug@thomsonreuters.com">michael.pflug@thomsonreuters.com</a>
wrote: <o:p></o:p></span></font></p>
<pre wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>I plan to utilize the dimension member caching feature implemented<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>with check in 10788 but I have a few questions I'm hoping the community<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>can help me out with before I get too far: <o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>1) The feature is dependant on having the property<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>mondrian.rolap.EnableRolapCubeMemberCache=false, but I don't fully<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>understand the consequences of setting this property to false. Can<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>anyone elaborate? <o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'> <o:p></o:p></span></font></pre>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'>This is a tricky point; my own understanding may
be warped, but I see it like this:<br>
Usually a schema defines dimension members by referring to a dimension table.
Mondrian creates a <i><span style='font-style:italic'>RolapMember</span></i>
object when it is needed, reading its attributes from the dimension table. The
resulting object is saved in a cache so it can be found again, avoiding reading
from the table again. The cache also guarantees there is a unique <i><span
style='font-style:italic'>RolapMember</span></i> for each member, and the cache
has "indexes" to find related members (parent, children, level-peers)
in constant time. It is a soft cache - unused members can be dropped from the
cache for garbage collection -- <br>
and this is valid because should the member be needed again, it will just be
read from the table and put again into the cache.<br>
<br>
This design assumes that the dimension table doesn't change. My new feature
helps deal with a dimension that changes in known small ways, letting an
application edit selected items in the cache, or flush them from the cache to
be reloaded with new values.<br>
<br>
However, checkin 10203 of last november changed the cache design, introducing a
two level cache. The goal was to deal with shared members in a shared
dimension, used by several cubes. Now a member is represented by both a
global <i><span style='font-style:italic'>RolapMember</span></i> (for all
cubes) and a local <i><span style='font-style:italic'>RolapCubeMember</span></i>
(one for each relevant cube). <br>
The cache structure is much more complicated -- so it seemed risky to alter it
to add the new features. Therefore I implemented them to act on the simpler,
single level member cache.<br>
The property <i><span style='font-style:italic'>EnableRolapCubeMemberCache</span></i>
was added so an application can choose the old one-level cache (which supports
my cache edits), or the newer two-level cache<br>
(which does not, but offers the advantages of checkin 10203). I assume that
10203 pays off for shared dimensions, and has no advantage otherwise.<br>
<br>
<br>
<o:p></o:p></span></font></p>
<pre wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>2) In the unit test MemberCacheControlTest.testDeleteCommand(), the<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>test allows two possible outcomes - one that flushes only the desired<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>member and one that flushes the entire level. Walking through the test<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>it always seems to flush the entire level which is arguably less<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>desirable. Does anyone understand this behavior? <o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'> <o:p></o:p></span></font></pre>
<p class=MsoNormal><st1:place w:st="on"><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt'>Flushing</span></font></st1:place>
more than requested is certainly sub-optimal, but strictly speaking it's not
incorrect, since mondrian might flush the member cache spontaneously to reclaim
space.<br>
<br>
<o:p></o:p></p>
<pre wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>3) The code specifically does not allow flushing of parent-child<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>dimensions and, as luck would have it, the dimension I am most<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>interested in flushing is parent-child. There is no comment as to why<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>parent-child isn't allowed - can anyone fill me in on what the<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>difficultly might be in implementing this?<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'> <o:p></o:p></span></font></pre>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'>I avoided parent/child hierarchies because they have a
more complex structure in the member cache. The existing design of member-cache
edits might accommodate them, or it might require a complete rewrite. I'd have
to try it and see. However I think a refactoring of the member cache is
likely in the near term, so it seems easier and maybe faster to wait for that,
rtsher than do a rewrite.<br>
<br>
<o:p></o:p></span></font></p>
<pre wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>4) Finally, my specific use case is that I have a volatile dimension<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>that I wish never to be cached. I could clear the cache manually before<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>each query, but I'd rather specify an optional property in my schema<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>telling Mondrian to never cache the dimension. Does anyone have any<o:p></o:p></span></font></pre><pre><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>objections to that implementation<o:p></o:p></span></font></pre>
<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt'>No, but that's a different goal to 10788, which
is intended to minimize dimension table reads, not force them.<br>
And it seems useful and (probably) simpler to implement than
member-cache-edits!<o:p></o:p></span></font></p>
</div>
</body>
</html>