[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mondrian
Subject:    Re: [Mondrian] Problem with 93 SQL queries for each member of month level of each year
From:       m.xinu <mehdi_xinu () yahoo ! com>
Date:       2012-12-03 15:03:48
Message-ID: 1354547028.83557.YahooMailNeo () web113905 ! mail ! gq1 ! yahoo ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]



I knew that, and before I send my second email, I did that either.

In
 fact I have a simple swing application to test and check my MDX 
queries, and after I changed my schema, I restarted it and I got the 
same problem.


________________________________
 From: Pedro Alves <pmgalves@gmail.com>
To: m.xinu <mehdi_xinu@yahoo.com>; Mondrian developer mailing list <mondrian@pentaho.org> 
Sent: Monday, December 3, 2012 2:50 PM
Subject: Re: [Mondrian] Problem with 93 SQL queries for each member of month level of each year
 
Yes - flush the mondrian cache, you made a mistake :)

On Mon 03 Dec 2012 02:47:03 PM WET, m.xinu wrote:
> Thanks for your reply
>
> I changed it to hasAll="true" and the problem still exists. Any
> suggestion?
>
> ------------------------------------------------------------------------
> *From:* Pedro Alves <pmgalves@gmail.com>
> *To:* Mondrian developer mailing list <mondrian@pentaho.org>
> *Sent:* Monday, December 3, 2012 2:38 PM
> *Subject:* Re: [Mondrian] Problem with 93 SQL queries for each member
> of month level of each year
>
> Yeah - don't use hasAll=false unless you have a very short number of
> first level members
>
> On Mon 03 Dec 2012 02:33:57 PM WET, Paul Stoellberger wrote:
> > The problem is most probably that you have hasAll="false"
> >
> > From what I understand thats not advisable to do that.
> > You could either a) do hasAll=true or b) set a default member for the
> > hierarchy, that could prevent the large number of sql queries
> >
> > -Paul
> >
> >
> > On Dec 3, 2012, at 3:31 PM, m.xinu wrote:
> >
> >> Hi,
> >>
> >> I have a common date dimension as follows
> >>
> >>    <Dimension name="Date">
> >>        <Hierarchy primaryKey="JALALI_ID" hasAll="false">
> >>            <Table schema="BIDWH" name="BAS_DM_DATE" />
> >>            <Level name="Year" column="J_YEAR" uniqueMembers="true"
> >> type="Integer"/>
> >>            <Level name="Month" column="J_MONTH" type="Integer"/>
> >>            <Level name="Day" column="J_DAY" type="Integer"/>
> >>        </Hierarchy>
> >>    </Dimension>
> >>
> >> and I used it in all my cubes such as Deposit:
> >>
> >>    <Cube name="Deposit" cache="false" enabled="true"
> >> defaultMeasure="DpCount">
> >>        <Table schema="BIDWH" name="COR_CB_DEPOSIT" />
> >>        <DimensionUsage name="OpenDate" source="Date"
> >> foreignKey="FD_OPENDATE"/>
> >>        <Measure name="DpCount" column="MS_DEPOSIT_ID"
> >> aggregator="distinct-count"/>
> >>        <Measure name="MinMainAcc" column="MR_MIN_MAINACCOUNT"
> >> aggregator="sum" />
> >>    </Cube>
> >>
> >> when I execute MDX:
> >>
> >> select
> >> [OpenDate].[Month].members on axis(0),
> >> [Measures].[DpCount] on axis(1)
> >> from Deposit
> >>
> >> or
> >>
> >> select
> >> [OpenDate].[Month].members on axis(0),
> >> [Measures].[MinMainAcc] on axis(1)
> >> from Deposit
> >>
> >> Mondrian executes 93 SQL queries for each month like the following:
> >>
> >> select "BAS_DM_DATE"."J_DAY" as "c0" from "BIDWH"."BAS_DM_DATE"
> >> "BAS_DM_DATE" where ("BAS_DM_DATE"."J_MONTH" = 1 and
> >> "BAS_DM_DATE"."J_YEAR" = 1384) group by "BAS_DM_DATE"."J_DAY" order
> >> by "BAS_DM_DATE"."J_DAY" ASC NULLS LAST
> >>
> >> I don't understand the reason of such queries. I have the same
> >> problem with other cubes, and it takes so long for some cubes.
> >> I checked the MDX in versions 3.3.0.14703, 3.4.1, and 3.5.0 and the
> >> results are the same.
> >>
> >> Is my configuration wrong? Is there any solution to solve the problem?
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> Mondrian mailing list
> >> Mondrian@pentaho.org <mailto:Mondrian@pentaho.org>
> <mailto:Mondrian@pentaho.org <mailto:Mondrian@pentaho.org>>
> >> http://lists.pentaho.org/mailman/listinfo/mondrian
> >
> >
> >
> > _______________________________________________
> > Mondrian mailing list
> > Mondrian@pentaho.org <mailto:Mondrian@pentaho.org>
> > http://lists.pentaho.org/mailman/listinfo/mondrian
> _______________________________________________
> Mondrian mailing list
> Mondrian@pentaho.org <mailto:Mondrian@pentaho.org>
> http://lists.pentaho.org/mailman/listinfo/mondrian
>
>
>
>
> _______________________________________________
> Mondrian mailing list
> Mondrian@pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
[Attachment #5 (text/html)]

<html><body><div style="color:#000; background-color:#fff; font-family:times new \
roman, new york, times, serif;font-size:12pt"><div>I knew that, and before I send my \
second email, I did that either.<br><br>In  fact I have a simple swing application to \
test and check my MDX  queries, and after I changed my schema, I restarted it and I \
got the  same problem.</div><div><br></div>  <div style="font-family: times new \
roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new \
roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" \
size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Pedro \
Alves &lt;pmgalves@gmail.com&gt;<br> <b><span style="font-weight: \
bold;">To:</span></b> m.xinu &lt;mehdi_xinu@yahoo.com&gt;; Mondrian developer mailing \
list &lt;mondrian@pentaho.org&gt; <br> <b><span style="font-weight: \
bold;">Sent:</span></b> Monday, December 3, 2012 2:50 PM<br> <b><span \
style="font-weight: bold;">Subject:</span></b> Re: [Mondrian] Problem with 93 SQL \
queries for each member of month level of each year<br> </font> </div> <br> Yes - \
flush the mondrian cache, you made a mistake :)<br><br>On Mon 03 Dec 2012 02:47:03 PM \
WET, m.xinu wrote:<br>&gt; Thanks for your reply<br>&gt;<br>&gt; I changed it to \
hasAll="true" and the problem still exists. Any<br>&gt; suggestion?<br>&gt;<br>&gt; \
------------------------------------------------------------------------<br>&gt; \
*From:* Pedro Alves &lt;<a ymailto="mailto:pmgalves@gmail.com" \
href="mailto:pmgalves@gmail.com">pmgalves@gmail.com</a>&gt;<br>&gt; *To:* Mondrian \
developer mailing list &lt;<a ymailto="mailto:mondrian@pentaho.org" \
href="mailto:mondrian@pentaho.org">mondrian@pentaho.org</a>&gt;<br>&gt; *Sent:* \
Monday, December 3, 2012 2:38 PM<br>&gt; *Subject:* Re: [Mondrian] Problem with 93 \
SQL queries for each member<br>&gt; of month level of each year<br>&gt;<br>&gt; Yeah \
- don't use hasAll=false unless you have a very short number of<br>&gt; first level \
members<br>&gt;<br>&gt; On Mon 03 Dec 2012 02:33:57 PM WET, Paul Stoellberger  \
wrote:<br>&gt; &gt; The problem is most probably that you have hasAll="false"<br>&gt; \
&gt;<br>&gt; &gt; From what I understand thats not advisable to do that.<br>&gt; &gt; \
You could either a) do hasAll=true or b) set a default member for the<br>&gt; &gt; \
hierarchy, that could prevent the large number of sql queries<br>&gt; &gt;<br>&gt; \
&gt; -Paul<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; On Dec 3, 2012, at 3:31 PM, m.xinu \
wrote:<br>&gt; &gt;<br>&gt; &gt;&gt; Hi,<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; I have a \
common date dimension as follows<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;&nbsp; &nbsp; \
&lt;Dimension name="Date"&gt;<br>&gt; &gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; \
&lt;Hierarchy primaryKey="JALALI_ID" hasAll="false"&gt;<br>&gt; &gt;&gt;&nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &lt;Table schema="BIDWH" name="BAS_DM_DATE" /&gt;<br>&gt; \
&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Level name="Year" \
column="J_YEAR" uniqueMembers="true"<br>&gt; &gt;&gt;  type="Integer"/&gt;<br>&gt; \
&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Level name="Month" \
column="J_MONTH" type="Integer"/&gt;<br>&gt; &gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &lt;Level name="Day" column="J_DAY" type="Integer"/&gt;<br>&gt; \
&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &lt;/Hierarchy&gt;<br>&gt; &gt;&gt;&nbsp; &nbsp; \
&lt;/Dimension&gt;<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; and I used it in all my cubes \
such as Deposit:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;&nbsp; &nbsp; &lt;Cube \
name="Deposit" cache="false" enabled="true"<br>&gt; &gt;&gt; \
defaultMeasure="DpCount"&gt;<br>&gt; &gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &lt;Table \
schema="BIDWH" name="COR_CB_DEPOSIT" /&gt;<br>&gt; &gt;&gt;&nbsp; &nbsp; &nbsp; \
&nbsp; &lt;DimensionUsage name="OpenDate" source="Date"<br>&gt; &gt;&gt; \
foreignKey="FD_OPENDATE"/&gt;<br>&gt; &gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &lt;Measure \
name="DpCount" column="MS_DEPOSIT_ID"<br>&gt; &gt;&gt;  \
aggregator="distinct-count"/&gt;<br>&gt; &gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; \
&lt;Measure name="MinMainAcc" column="MR_MIN_MAINACCOUNT"<br>&gt; &gt;&gt; \
aggregator="sum" /&gt;<br>&gt; &gt;&gt;&nbsp; &nbsp; &lt;/Cube&gt;<br>&gt; \
&gt;&gt;<br>&gt; &gt;&gt; when I execute MDX:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; \
select<br>&gt; &gt;&gt; [OpenDate].[Month].members on axis(0),<br>&gt; &gt;&gt; \
[Measures].[DpCount] on axis(1)<br>&gt; &gt;&gt; from Deposit<br>&gt; \
&gt;&gt;<br>&gt; &gt;&gt; or<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; select<br>&gt; \
&gt;&gt; [OpenDate].[Month].members on axis(0),<br>&gt; &gt;&gt; \
[Measures].[MinMainAcc] on axis(1)<br>&gt; &gt;&gt; from Deposit<br>&gt; \
&gt;&gt;<br>&gt; &gt;&gt; Mondrian executes 93 SQL queries for each month like the \
following:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; select "BAS_DM_DATE"."J_DAY" as "c0" \
from "BIDWH"."BAS_DM_DATE"<br>&gt; &gt;&gt; "BAS_DM_DATE" where \
("BAS_DM_DATE"."J_MONTH" = 1 and<br>&gt; &gt;&gt;  "BAS_DM_DATE"."J_YEAR" = 1384) \
group by "BAS_DM_DATE"."J_DAY" order<br>&gt; &gt;&gt; by "BAS_DM_DATE"."J_DAY" ASC \
NULLS LAST<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; I don't understand the reason of such \
queries. I have the same<br>&gt; &gt;&gt; problem with other cubes, and it takes so \
long for some cubes.<br>&gt; &gt;&gt; I checked the MDX in versions 3.3.0.14703, \
3.4.1, and 3.5.0 and the<br>&gt; &gt;&gt; results are the same.<br>&gt; \
&gt;&gt;<br>&gt; &gt;&gt; Is my configuration wrong? Is there any solution to solve \
the problem?<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;<br>&gt; \
&gt;&gt;<br>&gt; &gt;&gt; _______________________________________________<br>&gt; \
&gt;&gt; Mondrian mailing list<br>&gt; &gt;&gt; <a \
ymailto="mailto:Mondrian@pentaho.org" \
href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a> &lt;mailto:<a \
ymailto="mailto:Mondrian@pentaho.org" \
href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&gt;<br>&gt; &lt;mailto:<a \
ymailto="mailto:Mondrian@pentaho.org" \
href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a> &lt;mailto:<a \
ymailto="mailto:Mondrian@pentaho.org" \
href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&gt;&gt;<br>&gt; &gt;&gt; \
http://lists.pentaho.org/mailman/listinfo/mondrian<br>&gt; &gt;<br>&gt; &gt;<br>&gt; \
&gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; \
Mondrian mailing list<br>&gt; &gt; <a ymailto="mailto:Mondrian@pentaho.org" \
href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a> &lt;mailto:<a \
ymailto="mailto:Mondrian@pentaho.org" \
href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&gt;<br>&gt; &gt; <a \
href="http://lists.pentaho.org/mailman/listinfo/mondrian" \
target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>&gt; \
_______________________________________________<br>&gt; Mondrian mailing list<br>&gt; \
<a ymailto="mailto:Mondrian@pentaho.org"  \
href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a> &lt;mailto:<a \
ymailto="mailto:Mondrian@pentaho.org" \
href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>&gt;<br>&gt; <a \
href="http://lists.pentaho.org/mailman/listinfo/mondrian" \
target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; \
_______________________________________________<br>&gt; Mondrian mailing list<br>&gt; \
<a ymailto="mailto:Mondrian@pentaho.org" \
href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br>&gt; <a \
href="http://lists.pentaho.org/mailman/listinfo/mondrian" \
target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br><br><br> \
</div> </div>  </div></body></html>



_______________________________________________
Mondrian mailing list
Mondrian@pentaho.org
http://lists.pentaho.org/mailman/listinfo/mondrian


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic