[Mondrian] Aggregate Tables and Supremely Dodgy SQL

John V. Sichi jsichi at gmail.com
Thu Feb 26 00:34:33 EST 2009


Tom Barber wrote:
> Is this a bug, my crappy schema design(its not real its just my tests), or something else?

Hmmm...the agg designer did not generate this:

<AggForeignKey factColumn="cust_code" 
aggColumn="d_customers_Customer_Code" />

Instead it generated this:

<AggLevel column="d_customers_Customer_Code" 
name="[Customer.Customers].[Customer Code]">
</AggLevel>

So the bug would appear to be that the agg rewrite at MDX query time is 
deciding to join in the dimension table, but it has no foreign key 
mapping available, so you end up with the big slow cartesian product, 
which will also yield incorrect results--whereas the SQL didn't actually 
need any join at all (it could just group by d_customers_Customer_Code).

JVS




More information about the Mondrian mailing list