Database Reference
In-Depth Information
7.10 Query Performance in Mondrian
There are three main strategies for increasing performance when using the
Mondrian OLAP engine: tuning the underlying database, using materialized
views (called aggregate tables), and caching.
The data used by Mondrian are stored in a database. Tuning such database
is the first task to perform to enhance query performance. Since this task is
independent of the Mondrian engine and also given that Mondrian can work
with many kinds of databases, we do not address this issue here and focus on
topics that are specific to Mondrian, namely, materialized views and caching.
7.10.1 Aggregate Tables
In Mondrian, materialized views and summary tables studied in this chapter
are called aggregate tables . Physically, aggregate tables are created in the
database and populated during the ETL process. Mondrian can be configured
to use, if possible, aggregate tables when answering a query. Aggregate
tables can be enabled or disabled using a file called mondrian.properties .
The aggregated tables are disabled by default; they are enabled setting the
properties mondrian.rolap.aggregates.Use and mondrian.rolap.aggregates.Read
to true . Also, Mondrian provides a tool called Aggregation Designer to
assist in creating aggregate tables. This tool reads a schema and makes
recommendations for aggregate tables, generating SQL code to create and
populate the tables. We show below how to declare an aggregate table for
precomputing the average unit price and the total sales amount by year and
product category in the Northwind cube. The table will have the following
columns: Category , Year , RowCount , AvgUnitPrice ,and TotalSalesAmount .
< Cube name = '' Sales '' >
< Tablename= '' Sales '' >
< AggName name= '' SalesByMonthProduct '' >
< AggFactCount column= '' RowCount '' >
< AggMeasure name= '' Measures.AvgUnitPrice '' column= '' AvgUnitPrice '' >
< AggMeasure name= '' Measures.TotalSalesAmount ''
column= '' TotalSalesAmount '' >
< AggLevel name= '' Product.Category '' column= '' Category '' >
< AggLevel name= '' OrderDate.Year '' column= '' Year '' >
< /AggName >
< /Table >
< /Cube >
Note that this is a declaration of the aggregate table in the Mondrian
OLAP server. The actual table must be created in the underlying database
and populated, typically, during the ETL process.
We have studied in this topic that a parent-child hierarchy can have an
arbitrary depth. The classic example is the employee-supervisor relationship
Search WWH ::




Custom Search