<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16527" name=GENERATOR>
<STYLE>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=580334417-30082007><FONT face=Verdana
color=#000080 size=2>What happens if you replace the All members with another
member from the same dimension?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=580334417-30082007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=580334417-30082007><FONT face=Verdana
color=#000080 size=2>I hypothesize that the slow running time is due to the
sheer number of nested invocations - O(2^N) - not a problem specific to
All.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=580334417-30082007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=580334417-30082007><FONT face=Verdana
color=#000080 size=2>A variant of the NonEmptyCrossJoin function which took an
arbitrary number of arguments might be a solution. Then at least the arguments
to the function would only need to be evaluated once. The set constructor
operator '{ ... }' may look trivial, but it adds up.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=580334417-30082007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=580334417-30082007><FONT face=Verdana
color=#000080 size=2>Also try wrapping the arguments to each NonEmptyCrossJoin
in the Cache operator. (This would require a code change to
NonEmptyCrossJoinFunDef.java.) Would have the same effect.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=580334417-30082007><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=580334417-30082007><FONT face=Verdana
color=#000080 size=2>Julian</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> mondrian-bounces@pentaho.org
[mailto:mondrian-bounces@pentaho.org] <B>On Behalf Of </B>Robin
Tharappel<BR><B>Sent:</B> Wednesday, August 29, 2007 6:25 PM<BR><B>To:</B>
mondrian@pentaho.org<BR><B>Subject:</B> [Mondrian] performance impact of
having several cross joins ofdimensions at the All level<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hello,
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">We have observed a significant
slow down in performance when the there are several nested NonEmptyCrossJoin
calls in an MDX query. Below is an example query that shows the non empty
cross join of about 40 dimensions, however only 3 dimensions are not at the
All level ( Dim18, Dim20, and Dim28). We see a substantial improvement in
performance when the dimensions at the All level are removed. The performance
impact appears to be in lower CPU utilization for Mondrian. Since the other
dimensions are at the All level the expectation is that not much processing
would not be required for them. What is the overhead incurred for a dimension
at the All level in this case ? <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">WITH SET [#DataSet#] as
'NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin(NonEmptyCrossjoin({[Dim1].[All]},
{[Dim2].[All]}), {[Dim3].[All]}), {[Dim4].[All]}), {[Dim5].[All]}),
{[Dim6].[All]}), {[Dim7].[All]}), {[Dim8].[All]}), {[Dim9].[All]}),
{[Dim10].[All]}), {[Dim11].[All]}), {[Dim12].[All]}), {[Dim13].[All]}),
{[Dim14].[All]}), {[Dim15].[All]}), {[Dim16].[All]}), {[Dim17].[All]}),
{Descendants([Dim18].[All], 3)}), {[Dim19].[All]}), {[Dim20].[All].Children}),
{[Dim21].[All]}), {[Dim22].[All]}), {[Dim23].[All]}), {[Dim24].[All]}),
{[Dim25].[All]}), {[Dim26].[All]}), {[Dim27].[All]}),
{Descendants([Dim28].[All], 3)}), {[Dim29].[All]}), {[Dim30].[All]}),
{[Dim31].[All]}), {[Dim32].[All]}), {[Dim33].[All]}), {[Dim34].[All]}),
{[Dim35].[All]}), {[Dim36].[All]}), {[Dim37].[All]}), {[Dim38].[All]}),
{[Dim39].[All]}), {[Dim40].[All]}), {[Dim41].[All]}), {[Dim42].[All]}),
{[Dim43].[All]})' SELECT {[Measures].[Measure1], [Measures].[Measure2],
[Measures].[Measure3]} on columns, NON EMPTY Hierarchize({[#DataSet#]}) on
rows FROM [Transaction]<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Robin<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P></DIV>
<DIV>
<P>
<HR>
The information contained in this email may be confidential and/or legally
privileged. It has been sent for the sole use of the intended recipient(s). If
the reader of this message is not an intended recipient, you are hereby
notified that any unauthorized review, use, disclosure, dissemination,
distribution, or copying of this communication, or any of its contents, is
strictly prohibited. If you have received this communication in error, please
contact the sender by reply email and destroy all copies of the original
message. Thank you<BR><BR>
<P></P></DIV></BLOCKQUOTE></BODY></HTML>