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.
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.
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"?> <action-sequence> <title>Prime Mondrian Cache</title> <version>1</version> <logging-level>ERROR</logging-level> <documentation> <author/> <description>An example of priming Mondrian Cache</description> <help/> <result-type/> <icon/> </documentation> <inputs/> <outputs> </outputs> <resources> </resources> <actions> </actions> </action-sequence>
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:
<resources> <catalog> <url> <location>solution:steel-wheels/analysis/steelwheels.mondrian.xml</location> <mime-type>text/xml</mime-type> </url> </catalog> </resources>