[Mondrian] Re: [Fwd: Eigenbase perforce change 8704 for review]

John V. Sichi jsichi at gmail.com
Tue Feb 27 00:42:30 EST 2007


Followup performance analysis revealed that the overconservatism of this 
fix had a significant negative impact on performance.  I'll have someone 
working on an optimal fix, but it may not be for a few weeks.  In the 
meantime, if you'd prefer the bug to the performance drag, comment out 
the body of RolapResult.clearNamedSets.

JVS

John V. Sichi wrote:
> Review comments on the change below are welcome.  The test case 
> illustrates why I had to make it, but there's probably a smart way to 
> avoid re-evaluating named set expressions which don't need it.
> 
> JVS
> 
> -------- Original Message --------
> Subject: Eigenbase perforce change 8704 for review
> Date: Tue, 13 Feb 2007 01:58:01 -0800 (PST)
> From: John V. Sichi <jsichi at gmail.com>
> To: Andreas Voss <tonbeller at a-voss.de>, Bart Pappyn 
> <bppn at users.sourceforge.net>, Hartmut Haas <Hartmut_Haas at tonbeller.com>, 
> Julian Hyde <jhyde at users.sourceforge.net>, John V. Sichi 
> <jsichi at gmail.com>, Kinkoi Lo <kinkoi at gmail.com>, Matt Campbell 
> <Matthew.Campbell at thomson.com>, Sam Birney <sbirney at jaspersoft.com>
> 
> http://p4web.eigenbase.org/@md=d&c=6PU@//8704?ac=10
> 
> Change 8704 by jvs at jvs.kotick.eigenbase on 2007/02/13 01:58:00
> 
>     MONDRIAN:  clear named set cache whenever cache of other
>     expressions is cleared; otherwise, an incorrect value
>     for a named set can be reused
> 
> Affected files ...
> 
> ... //open/mondrian/src/main/mondrian/rolap/RolapEvaluator.java#55 edit
> ... //open/mondrian/src/main/mondrian/rolap/RolapResult.java#89 edit
> ... //open/mondrian/testsrc/main/mondrian/test/ClearViewTest.java#3 edit
> 
> Differences ...
> 
> ==== //open/mondrian/src/main/mondrian/rolap/RolapEvaluator.java#55 
> (ktext) ====
> 
> 2c2
> < // $Id: //open/mondrian/src/main/mondrian/rolap/RolapEvaluator.java#54 $
> ---
>> // $Id: //open/mondrian/src/main/mondrian/rolap/RolapEvaluator.java#55 $
> 39c39
> <  * @version $Id: 
> //open/mondrian/src/main/mondrian/rolap/RolapEvaluator.java#54 $
> ---
>>  * @version $Id: 
>> //open/mondrian/src/main/mondrian/rolap/RolapEvaluator.java#55 $
> 186a187,192
>>          * Clears cached values for all named sets.
>>          */
>>         protected void clearNamedSets() {
>>         }
>>
>>         /**
> 659a666,673
>>
>>         // Clear cached named sets at the same time we clear other cached
>>         // expressions.  This may be overconservative in some cases, but
>>         // without this, there can be bugs when incorrect results get 
>> cached
>>         // for named sets which depend on measures which haven't been 
>> loaded
>>         // yet.  See mondrian.test.ClearViewTest.testLer4260 for an
>>         // example.
>>         root.clearNamedSets();
> 
> ==== //open/mondrian/src/main/mondrian/rolap/RolapResult.java#89 (ktext) 
> ====
> 
> 2c2
> < // $Id: //open/mondrian/src/main/mondrian/rolap/RolapResult.java#88 $
> ---
>> // $Id: //open/mondrian/src/main/mondrian/rolap/RolapResult.java#89 $
> 40c40
> <  * @version $Id: 
> //open/mondrian/src/main/mondrian/rolap/RolapResult.java#88 $
> ---
>>  * @version $Id: 
>> //open/mondrian/src/main/mondrian/rolap/RolapResult.java#89 $
> 809a810,813
>>         protected void clearNamedSets() {
>>             namedSetValues.clear();
>>         }
>>
> 
> ==== //open/mondrian/testsrc/main/mondrian/test/ClearViewTest.java#3 
> (ktext) ====
> 
> 2c2
> < // $Id: //open/mondrian/testsrc/main/mondrian/test/ClearViewTest.java#2 $
> ---
>> // $Id: //open/mondrian/testsrc/main/mondrian/test/ClearViewTest.java#3 $
> 20c20
> <  * @version $Id: 
> //open/mondrian/testsrc/main/mondrian/test/ClearViewTest.java#2 $
> ---
>>  * @version $Id: 
>> //open/mondrian/testsrc/main/mondrian/test/ClearViewTest.java#3 $
> 164a165,198
>>
>>     /**
>>      * Tests a bug with incorrect reuse of a named set which can't be
>>      * computed directly against a cold cache.
>>      */
>>     public void testLer4260() {
>>         assertQueryReturns(
>>             "With Set [*BMEL] as \n" +
>>             "'[Education Level].[Education Level].Members' \n" +
>>             "Member [Measures].[*TBM] as \n" +
>>             "'Rank([Education Level].CurrentMember, \n" +
>>             "Order([*BMEL],([Measures].[Unit Sales]),BDESC))' \n" +
>>             "Set [*SM_RSUM_SET_0] as \n" +
>>             "'Filter([*BMEL],[Measures].[*TBM] <= 3)'\n" +
>>             "select [*SM_RSUM_SET_0] on rows, \n" +
>>             "{[Measures].[*TBM], [Measures].[Unit Sales]} on columns 
>> \n" +
>>             "From [Sales]",
>>             fold(
>>                 "Axis #0:\n" +
>>                 "{}\n" +
>>                 "Axis #1:\n" +
>>                 "{[Measures].[*TBM]}\n" +
>>                 "{[Measures].[Unit Sales]}\n" +
>>                 "Axis #2:\n" +
>>                 "{[Education Level].[All Education Levels].[Bachelors 
>> Degree]}\n" +
>>                 "{[Education Level].[All Education Levels].[High 
>> School Degree]}\n" +
>>                 "{[Education Level].[All Education Levels].[Partial 
>> High School]}\n" +
>>                 "Row #0: 3\n" +
>>                 "Row #0: 68,839\n" +
>>                 "Row #1: 2\n" +
>>                 "Row #1: 78,664\n" +
>>                 "Row #2: 1\n" +
>>                 "Row #2: 79,155\n"));
>>     }
> 
> 




More information about the Mondrian mailing list