This article describes how to prime specific Mondrian queries in the Pentaho BI Server, as well as demonstrating how to use Mondrian's Cache Control API within the Pentaho BI Server.

Priming Mondrian Cache

Let's say you update your data warehouse on a nightly basis, and know some of the MDX queries that folks use during the day for dashboards, reporting and analysis.  You can pre-populate Mondrian's cache before standard usage of the system to get a leg up on performance.  Here's how you do it.

Step 1: Create an Action Sequence

Start off by creating a basic action sequence.  You could do this in Design Studio or via an XML editor.  Here an empty xaction we can build on.  Place this in the solution repository:

<?xml version="1.0" encoding="UTF-8"?>
  <title>Prime Mondrian Cache</title>
    <description>An example of priming Mondrian Cache</description>

Step 2: Define a Mondrian Connection

This is a very important step.  There are many ways to define a Mondrian Connection, and there are many properties you can set.  It's very important that the Reporting, Analysis, and Dashboards you use along with this action sequence share the identical Mondrian Connection.  In this example, we'll use the already defined connection information in pentaho-solutions/system/olap/datasources.xml for SteelWheelsSales.

First, you need to add a resource to reference the Mondrian catalog: