<div dir="ltr">Thank you very much for the explanation. I did a quick test with it in mind and the difference is noticeable. Same query that took 10s to execute with <span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">ExpandNonNative=true</span> went up to 17s when i turned it to false.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 27, 2014 at 1:28 PM, Matt Campbell <span dir="ltr">&lt;<a href="mailto:mcampbell@pentaho.com" target="_blank">mcampbell@pentaho.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
ExpandNonNative increases the number of cases where push down logic can be used.  It does this by evaluating sub-expressions that cannot be easily optimized within a crossjoin, and then inlining the resulting sets into a new cross join argument.  This can help in many scenarios.  For example, with your query the Filter expression within a crossjoin arg caused the optimization logic to fail, but Mondrian then expanded out that filter.  Had it actually returned any tuples, those tuples would have been used in constraining the tuple set used for the outer crossjoin.  If [Fuel].members in your query had 10s of thousands of members that extra optimization could have a big impact on query time.<br>

<br>
Whether to have it on or off depends a lot on your workload, dimension cardinality, and model.  I&#39;d suggest running some tests with typical queries using both settings to see how much it will impact you.<br>
<div class=""><br>
<br>
<br>
________________________________________<br>
From: <a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a> [<a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a>] On Behalf Of Hilario Fernandes [<a href="mailto:hilario.fernandes@cortex-intelligence.com">hilario.fernandes@cortex-intelligence.com</a>]<br>

</div>Sent: Thursday, March 27, 2014 8:59 AM<br>
<div class="">To: Mondrian developer mailing list<br>
Subject: Re: [Mondrian] RolapNativeSet NPE<br>
<br>
</div><div class="">Yes Matt, i do have it enabled. These are my native setttings:<br>
<br>
mondrian.native.crossjoin.enable=true<br>
mondrian.native.filter.enable=true<br>
mondrian.native.nonempty.enable=true<br>
mondrian.native.topcount.enable=true<br>
mondrian.native.ExpandNonNative=true<br>
mondrian.native.EnableNativeRegexpFilter=true<br>
<br>
I followed some indications on <a href="http://infocenter.pentaho.com/help/index.jsp?topic=%2Fperformance_tuning_guide%2Fconcept_mondrian_properties.html" target="_blank">http://infocenter.pentaho.com/help/index.jsp?topic=%2Fperformance_tuning_guide%2Fconcept_mondrian_properties.html</a> to set it to true. I supposed with those i&#39;d have the optimal performance.<br>

<br>
I can confirm that the error is gone when setting  mondrian.native.ExpandNonNative=false.<br>
<br>
Is there any major hit in performance for having it to false with large datasets, or does any of the other options depend on this one to work?<br>
<br>
Thank you for opening the issue, and for your attention.<br>
<br>
<br>
<br>
<br>
<br>
</div><div class="">On Thu, Mar 27, 2014 at 12:39 PM, Matt Campbell &lt;<a href="mailto:mcampbell@pentaho.com">mcampbell@pentaho.com</a>&lt;mailto:<a href="mailto:mcampbell@pentaho.com">mcampbell@pentaho.com</a>&gt;&gt; wrote:<br>

<br>
<br>
Hi Hilario-<br>
I was able to reproduce what you were seeing by setting ExpandNonNative=true.  Can you confirm you have that property set as well?  (I believe that&#39;s the default setting in biserver)<br>
<br>
I&#39;ve logged MONDRIAN-1964 for the issue.<br>
<br>
-matt<br>
<br>
________________________________________<br>
</div>From: <a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a>&lt;mailto:<a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a>&gt; [<a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a>&lt;mailto:<a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a>&gt;] On Behalf Of Hilario Fernandes [<a href="mailto:hilario.fernandes@cortex-intelligence.com">hilario.fernandes@cortex-intelligence.com</a>&lt;mailto:<a href="mailto:hilario.fernandes@cortex-intelligence.com">hilario.fernandes@cortex-intelligence.com</a>&gt;]<br>

<div class="">Sent: Thursday, March 27, 2014 6:39 AM<br>
To: Mondrian developer mailing list<br>
Subject: Re: [Mondrian] RolapNativeSet NPE<br>
<br>
Thank you for your reply.<br>
<br>
I&#39;ve tryed version 3.6.2 and 3.6.5 with the same results.<br>
<br>
Should i fill in a bug report? Under which project should i do it? I&#39;ve opened bugs in the wrong place in the past, just want to make sure i put it on the right place this time!<br>
<br>
<br>
</div><div class="">On Wed, Mar 26, 2014 at 6:33 PM, Luc Boudreau &lt;<a href="mailto:lucboudreau@gmail.com">lucboudreau@gmail.com</a>&lt;mailto:<a href="mailto:lucboudreau@gmail.com">lucboudreau@gmail.com</a>&gt;&lt;mailto:<a href="mailto:lucboudreau@gmail.com">lucboudreau@gmail.com</a>&lt;mailto:<a href="mailto:lucboudreau@gmail.com">lucboudreau@gmail.com</a>&gt;&gt;&gt; wrote:<br>

Looks like a bug.<br>
<br>
Which version is this? I vaguely remember seeing this before.<br>
<br>
Luc<br>
<br>
<br>
</div><div><div class="h5">On Wed, Mar 26, 2014 at 2:30 PM, Hilario Fernandes &lt;<a href="mailto:hilario.fernandes@cortex-intelligence.com">hilario.fernandes@cortex-intelligence.com</a>&lt;mailto:<a href="mailto:hilario.fernandes@cortex-intelligence.com">hilario.fernandes@cortex-intelligence.com</a>&gt;&lt;mailto:<a href="mailto:hilario.fernandes@cortex-intelligence.com">hilario.fernandes@cortex-intelligence.com</a>&lt;mailto:<a href="mailto:hilario.fernandes@cortex-intelligence.com">hilario.fernandes@cortex-intelligence.com</a>&gt;&gt;&gt; wrote:<br>

Hi everyone,<br>
<br>
I&#39;m implementing a system that creates mdx queries and passes these to Mondrian to be executed. During my tests I have found a problem when using mondrian.native.crossjoin.enable=true.<br>
<br>
If I try to do a query such as this:<br>
<br>
SELECT<br>
NON EMPTY {[Measures].[Price_SUM]} ON COLUMNS,<br>
NON EMPTY CrossJoin({Filter({[Brand].[Brand].Members}, [Brand].CurrentMember.Name MATCHES &#39;(?i).*zzzzz.*&#39;)}, {[Fuel].[Fuel].Members}) ON ROWS<br>
FROM [Cars]<br>
<br>
<br>
Where we have a CrossJoin of a Filter over Brand members with the fuel members. The problem is that whenever the first argument of the CrossJoin is a filter that returns empty (no values matched) i get a NullPointerException from mondrian.<br>

<br>
<br>
java.lang.NullPointerException<br>
at mondrian.rolap.RolapNativeSet$SetEvaluator.execute(RolapNativeSet.java:186)<br>
at mondrian.olap.fun.CrossJoinFunDef$CrossJoinIterCalc.evaluateIterable(CrossJoinFunDef.java:177)<br>
at mondrian.rolap.RolapResult.executeAxis(RolapResult.java:875)<br>
at mondrian.rolap.RolapResult.evalLoad(RolapResult.java:700)<br>
at mondrian.rolap.RolapResult.loadMembers(RolapResult.java:656)<br>
at mondrian.rolap.RolapResult.&lt;init&gt;(RolapResult.java:288)<br>
at mondrian.rolap.RolapConnection.executeInternal(RolapConnection.java:671)<br>
at mondrian.rolap.RolapConnection.access$000(RolapConnection.java:51)<br>
at mondrian.rolap.RolapConnection$1.call(RolapConnection.java:622)<br>
at mondrian.rolap.RolapConnection$1.call(RolapConnection.java:621)<br>
<br>
<br>
Anyone has an idea of the problem?<br>
<br>
--<br>
Hilario Fernandes<br>
<br>
_______________________________________________<br>
Mondrian mailing list<br>
</div></div><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&lt;mailto:<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&gt;&lt;mailto:<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&lt;mailto:<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&gt;&gt;<br>

<div class=""><a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
<br>
<br>
<br>
_______________________________________________<br>
Mondrian mailing list<br>
</div><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&lt;mailto:<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&gt;&lt;mailto:<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&lt;mailto:<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&gt;&gt;<br>

<div class="HOEnZb"><div class="h5"><a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
<br>
<br>
<br>
<br>
--<br>
Hilario Fernandes<br>
_______________________________________________<br>
Mondrian mailing list<br>
<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&lt;mailto:<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&gt;<br>
<a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
<br>
<br>
<br>
--<br>
Hilario Fernandes<br>
_______________________________________________<br>
Mondrian mailing list<br>
<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br>
<a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Hilario Fernandes</div></div>
</div>