Mondrian

Contents:

Mondrian is Pentaho's OLAP engine, allowing for analysis reporting and more.

Sub-pages

Logging

See our Pentaho logs page.

Performance tuning

These are some things you can do to improve the performance of Mondrian. For best results, try the more general Pentaho performance tuning methods first.

Pre-load data into the cache

Mondrian will operate much faster if results can be loaded from the cache.

  1. Clear the cache. This can be achieved by
    • restarting the server, or
    • running the option on the Admin page. This can be executed remotely, e.g. for scripting.
  2. Run MDX queries that will fill the cache with the data you'll be accessing.

Mondrian cache control

One of the strengths of mondrian's design is that you don't need to do any processing to populate special data structures before you start running OLAP queries. More than a few people have observed that this makes mondrian an excellent choice for 'real-time OLAP' -- running multi-dimensional queries on a database which is constantly changing.

The problem is that mondrian's cache gets in the way. Usually the cache is a great help, because it ensures that mondrian only goes to the DBMS once for a given piece of data, but the cache becomes out of date if the underlying database is changing.

This is solved with a set of APIs for cache control. Here is basic concept and method in Pentaho Mondrian wiki

However, the link does not tell how to implement the mondrian cache control practically. Here is an example of partially flush in Pentaho 2.0 platform. See the Attachments on this page.

Extract cache-control.tar.gz to your pentaho-solutions directory. You might find out there are sample mondrian schema, a sample mdx query report and a short test sql script. The purpose of the Mondrian3.jsp file attached is for flushing the data under 'Finance' department.

Moreover, you need create a JNDI connection in tomcat for your datasource. This includes adding the Resource to pentaho.war/META-INF/context.xml. Also, you must add the resource-ref to pentaho.war/WEB-INF/web.xml.

Edit context.xml

<Resource name="jdbc/SampleData" auth="Container" type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5"
maxWait="10000" username="pentaho_user" password="password"
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/sampledata"
/>

and edit web.xml:

<resource-ref>
<description>SampleData</description>
<res-ref-name>jdbc/SampleData</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

You can test it in your machine. Hopefully you can correct results after the practice.

Parent-child hierarchy and closure table

There is a very helpful closure doc on pentaho mondrian wiki. But we suggest you'd better think it through before you actually take any action on your parent-child hierarchy. Parent-child hierarchy is common in almost all organizations. In order to build a proper parent-child hierarchy, there are at least three rules we need follow.

  1. One child must have one and only one parent. On the other hand, parent might have multiple children. Thus, effectively, parent-child hierarchy should be called as parent-children hierarchy.
  2. No missing node. In another words, hierarchy must be completed.
  3. No duplicated nodes. That is member in hierarchy must be unique.

Other resources

Resources

last modified by sd on 16/10/2009 at 11:13

Creator: sd on 2008/08/08 14:33
XWiki Enterprise 1.7.2.16857 - Documentation