<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=093331310-03052007><FONT face=Arial 
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial size=2>Since the new non 
empty optimizer code, a few queries run very slow in my application (for 1 sec 
(before mondrian 2.3.2)&nbsp;-&gt; 5 minutes).</FONT></SPAN></DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial size=2>I tried to simulate 
the problem with the foodmart cube, but I am not successful (the foodmart schema 
is too simple,&nbsp;I guess).</FONT></SPAN></DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial size=2>Even a simple 
crossjoin with two all-level sets takes a very long time, so the size of 
dimensions does not matter. </FONT></SPAN><SPAN class=093331310-03052007><SPAN 
class=093331310-03052007><FONT face=Arial size=2>I have a very large number of 
calculated members and many calculated members need calculations based on many 
other calculated members (deeply nested).&nbsp; The same query runs very fast 
(&lt; 1 sec) without NON empty.</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=093331310-03052007><SPAN class=093331310-03052007><FONT 
face=Arial size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><SPAN class=093331310-03052007><FONT 
face=Arial size=2>Mondrian seems to get stuck forever in the first 
CrossJoinFunDef.nonEmptyListNEW(), it only leaves after a very long time.&nbsp; 
</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=093331310-03052007><SPAN class=093331310-03052007><FONT 
face=Arial size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><SPAN class=093331310-03052007><FONT 
face=Arial size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><SPAN class=093331310-03052007><FONT 
face=Arial size=2>--&gt; Can someone please explain to me or hint me why this 
function could be slow ?&nbsp; Is it due to the fact that I have large number of 
calculated members?&nbsp; I looked at the code, ran it through the debugger, but 
I don't understand what the function is exactly doing and why this takes such a 
long time.&nbsp; </FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=093331310-03052007><SPAN class=093331310-03052007><FONT 
face=Arial size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><SPAN class=093331310-03052007><FONT 
face=Arial size=2>If I could understand the pitfalls of this function a bit 
better, I might be able to pinpoint (and solve) the 
problem.</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=093331310-03052007><SPAN class=093331310-03052007><FONT 
face=Arial size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><SPAN class=093331310-03052007><FONT 
face=Arial size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><SPAN class=093331310-03052007><FONT 
face=Arial size=2>Where is the query that takes a long time, translated to 
foodmart data (just an example, since it runs fast on the&nbsp;foodmart schema) 
:</FONT></SPAN></DIV></SPAN>
<DIV><SPAN class=093331310-03052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial size=2>WITH MEMBER 
[Measures].[Availability] as 'iif([Measures].[Warehouse Sales] &gt; 0, 
[Measures].[Warehouse Profit] / [Measures].[Warehouse Sales], null)'<BR>MEMBER 
[Measures].[Performance] as 'iif([Measures].[Store Sales] &gt; 0, 
[Measures].[Profit] / [Measures].[Store Sales], null)'<BR>MEMBER 
[Measures].[Quality] as 'iif([Measures].[Units Ordered] &gt; 0, 
[Measures].[Units Shipped] / [Measures].[Units Ordered], 
null)'</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial size=2>MEMBER 
[Measures].[Overall eff] as 'iif(IsEmpty([Measures].[Availability]) or 
IsEmpty([Measures].[Performance]) or IsEmpty([Measures].[Quality]), null, 
cast([Measures].[Availability] as NUMERIC) * cast([Measures].[Performance] as 
NUMERIC) * cast([Measures].[Quality] as NUMERIC))'</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial size=2>MEMBER 
[Measures].[Availability Loss tmp] as 'iif([Measures].[Availability] &gt; 0, 1.0 
- [Measures].[Availability], 0)'<BR>MEMBER [Measures].[Performance Loss tmp] as 
'iif([Measures].[Performance] &gt; 0, 1.0 - [Measures].[Performance], 
0)'<BR>MEMBER [Measures].[Quality Loss tmp] as 'iif([Measures].[Quality] &gt; 0, 
1.0 - [Measures].[Quality], 0)'<BR>MEMBER [Measures].[Sum loss tmp] as 
'[Measures].[Availability loss tmp] + [Measures].[Performance loss tmp] + 
[Measures].[Quality loss tmp]'<BR>MEMBER [Measures].[Overall eff loss tmp] as 
'iif([Measures].[Overall eff] &lt; 1.0, 1.0 - [Measures].[Overall eff], 
0.0)'</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial size=2>MEMBER 
[Measures].[Availability loss] as 'iif(IsEmpty([Measures].[Overall eff]), null, 
iif([Measures].[Sum loss tmp] &gt; 0, [Measures].[Overall eff loss tmp] * 
([Measures].[Availability loss tmp] / [Measures].[Sum loss tmp]), 
0))'</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial size=2>SELECT NON EMPTY 
{[Measures].[Availability loss]} ON COLUMNS,<BR>NON EMPTY CrossJoin( {[Promotion 
Media].[All Media]}, {[Product].[All Products]} ) ON ROWS<BR>FROM [Warehouse and 
Sales]</FONT></SPAN></DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial 
size=2>Thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=093331310-03052007><FONT face=Arial 
size=2>Bart</FONT></SPAN></DIV></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>