IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

54
IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS ® Environment Clifford M. Broughton [email protected] IBM International Competency Center at SAS Institute May, 2005

Transcript of IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

Page 1: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and

DB2 Materialized Query Tables in a SAS® Environment

Clifford M. Broughton

[email protected]

IBM International Competency Center at SAS Institute

May, 2005

Page 2: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

ii

Contents The SAS and IBM Relationship.........................................................................................................1 Audience ...........................................................................................................................................1 Introduction .......................................................................................................................................2 What Are Materialized Query Tables? ..............................................................................................3 Why Use MQTs?...............................................................................................................................3 What Is DB2 Cube Views?................................................................................................................4 Will DB2 Cube Views and MQTs Help a SAS Environment? ............................................................4 Why Have both DB2 Cube Views and SAS OLAP Server? ..............................................................6 How to Use MQTs.............................................................................................................................7 Creating MQTs..................................................................................................................................7 Create Better MQTs – A Tale of Two Advisors .................................................................................8

DB2 Design Advisor ......................................................................................................................8 DB2 Cube Views ...........................................................................................................................8 DB2 Version 8.2 Improvements ....................................................................................................9

Which Advisor Should I Use?............................................................................................................9 Use the DB2 Cube Views Optimization Advisor, First! ................................................................10

Tips for Influencing the DB2 Cube Views Optimization Advisor ......................................................11 A Word about Test Procedures .......................................................................................................12 Performance Test: A Simple MQT Example....................................................................................12

Environment for First Test ...........................................................................................................12 Simple MQT Example .................................................................................................................12 Results ........................................................................................................................................15 Environment for Second Test......................................................................................................16

Performance Test: DB2 Cube Views Support of a SAS OLAP Cube…………………………………16 Database.....................................................................................................................................17 Cube Model.................................................................................................................................17 Description of Tests ....................................................................................................................17 Test Procedure............................................................................................................................18 Results of Tests ..........................................................................................................................18

Conclusions.....................................................................................................................................19 DB2 MQTs and DB2 Cube Views Improve Performance ............................................................19 SAS OLAP Server and SAS OLAP Cube Studio Use MQTs and DB2 Cube Views....................19 Summary.....................................................................................................................................19

Appendix A: DDL for Creating Test Database................................................................................20 Database and DBM Configuration...............................................................................................20 DDL for Creating Tables .............................................................................................................20

Appendix B: OLAP Cube Models ...................................................................................................28 Baseline Cube File ......................................................................................................................28 Aggregation Cube File ................................................................................................................30

Appendix C: DB2 Cube Views Model Export..................................................................................31 Appendix D: Test Files ...................................................................................................................49

Test – olmdgb4p .........................................................................................................................49 Test – olmdgb5h .........................................................................................................................50

References......................................................................................................................................51 Resources.......................................................................................................................................51 To Find Out More ............................................................................................................................51

Tables Table 1: Effect of Order of Advisor Execution .................................................................................10 Table 2 Cardinality of Base Table and MQT ...................................................................................14 Table 3. Test Results - SAS Usage of a DB2 Materialized Query Table........................................15 Table 4. Native DB2 Query – Times of Execution ..........................................................................16 Table 5 Test Execution Times with and without DB2 Cube Views MQTs .......................................18

Page 3: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Acknowledgements This paper was produced by the IBM International Competency Center (ICC) at SAS Institute in cooperation with SAS Institute Inc. The principal author is Clifford M. Broughton of the IBM ICC, a DB2 specialist working with SAS Institute. Many people contributed to this document and to the underlying research. While the author thanks them all, the following individuals deserve special thanks for their efforts:

• Pat Bates and Virginia Hoffman of IBM

• Ann Weinberger, Matthias Ender, Chris DeHart and Nancy Wills of SAS Institute

The SAS and IBM Relationship Since its founding in 1976, IBM and SAS Institute have had a technological relationship that has expanded to include joint solution development and marketing. The IBM partnership with SAS is a true win-win situation for both SAS and IBM. SAS benefits from IBM’s experience in integrating technologies, and IBM aligns itself with a market leader in business intelligence. As a result, mutual customers benefit from getting the most complete set of business intelligence and analytical solutions on the market.

Audience This document is written for multiple audiences. Decision makers will get an overview of the benefits of the combination of SAS and IBM products. Technical specialists will gain a more in-depth understanding of how SAS and IBM products function together. Everyone, from basic users to designers to c-level executives, can learn something beneficial from this document.

We recommend that readers consider this document as a reference. Read the sections that relate to your specific needs. For example, a decision maker will probably be interested in the introduction, the conclusion, and some of the descriptive sections in between; a technical specialist might want to focus on the performance testing and the appendices. Use it like a menu. There’s something here for everyone.

1

Page 4: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Introduction This guide gives readers an overview and an understanding of how Materialized Query Tables (MQTs) can benefit SAS users and SAS applications that use DB2 as the underlying database and how to gain a greater benefit by adding DB2 Cube Views to the combination of SAS, MQTs and DB2. This paper explores some of the primary benefits of using MQTs and DB2 Cube Views in any SAS environment, particularly, in a SAS OLAP environment.

MQTs can provide a substantial performance increase by storing data aggregations that are used for queries and reports. The DB2 Design Advisor, which is included with DB2, can make recommendations about specific MQTs for your current environment and captured workload.

DB2 Cube Views extends this benefit by designing MQTs that are based, not so much on the database and workload environment, but, more importantly, on OLAP objects that are contained in the DB2 database. Now, star schemas, cube models, cubes, fact and dimension tables, levels, hierarchies, and measures are considered by the DB2 Cube Views Optimization Advisor when designing these MQTs. Although the MQTs can be manually designed by a developer who has an extensive knowledge of the database, the cube model, any cubes—you get the idea—there are many opportunities for error, especially when updates or changes are made to the cubes or the cube model, or when another developer who isn’t as familiar with the environment must make the changes. DB2 Cube Views allows all the metadata about the design of the cube model and all its cubes to be entered and saved, and provides a powerful advisor that is specifically tasked with designing MQTs to support OLAP environments. Developers can accelerate the design of the MQTs with much less effort and less chance of error. When changes to the cube model or any of its components are made, generating new MQTs is also a simple process. DB2 Cube Views analyzes the environment and generates an efficient set of MQTs in support of the targeted use that you specify such as drill through queries, multidimensional OLAP or MOLAP extraction, reports, or a custom or a hybrid purpose.

In combination, these tools now provide a way to produce and efficiently store pre-aggregated data in the database, thereby reducing query processing time while minimizing the additional resources needed. The result is often a very dramatic performance increase!

But how does this play into a SAS environment, especially with SAS OLAP Server and SAS OLAP Cube Studio? SAS OLAP Server provides a very powerful and extensive MOLAP data store and an equally impressive querying, reporting, and ETL environment. The addition of DB2 Cube Views and MQTs can dramatically accelerate the performance of SAS OLAP queries to the database.

Occasionally, SAS OLAP Server must access the underlying DB2 database for data. Perhaps the MOLAP model was intentionally designed to support only the top levels of the cube model, and a query requires data at a more granular level. To satisfy this drill-through query, SAS must reach into the underlying data in the DB2 database. In another scenario, SAS OLAP Server must refresh the MOLAP data, periodically, or might need a full aggregation of a cube to generate reports. In all these scenarios, DB2 Cube Views can design an efficient set of MQTs to support these requirements. The data in these MQTs can be refreshed automatically or periodically, and be kept available to accelerate the process of fulfilling these queries.

SAS Foundation technology, SAS OLAP Server, and SAS OLAP Cube Studio with IBM DB2 and DB2 Cube Views, all significant packages in themselves, complement each other to extend the

2

Page 5: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

strengths of the entire environment. This combination of IBM and SAS software and tools ultimately provides a very powerful and efficient environment to store, query, analyze, and exploit data for business use.

What Are Materialized Query Tables? Simply stated, Materialized Query Tables (MQTs) contain the results of queries. In fact, the Data Definition Language (DDL), or SQL code, that’s used to create an MQT contains a query at its center. MQTs are based on queries of base tables. (A “base table” is a regular table on which an MQT is based.) The data that’s contained in an MQT is usually an aggregation or summary of the data that’s in the underlying base tables. In fact, earlier versions of DB2 had Automatic Summary Tables, which are a subset of MQTs.

When discussing the data that’s contained in an MQT, you must also consider data “currency,” that is, how current is the data? Is it in sync with the data in the underlying base tables, or has the underlying data been updated since the MQT was last populated? Does currency matter for the application? Sometimes, the data needs to be kept current in as close to real time as possible, perhaps to make sure that bank balances are sufficient. Alternatively, data might need to be captured in a snapshot and held, for example, when generating month-end or year-end reports. While the production system might need to keep updating, the MQTs can be refreshed at the end of the time period, which gives a fixed snapshot for consistent and extensive analysis.

To support these scenarios, MQTs can be maintained automatically by DB2 or maintained manually and updated by the user or an application. Each method has advantages and disadvantages. For example, system-maintained MQTs are always current and available for use, but the data in them cannot be altered. User-maintained MQTs can be altered for what-if types of analysis or can capture a snapshot in time and be held. However, the data in the MQT might not be sufficiently current at any given time unless the user updates the data again. In the latter case, MQTs can also have staging tables where delta data can be queued until processed into the MQT by a table refresh. This can substantially accelerate the update/refresh process. For details, see the DB2 documentation resources that are listed at the end of this paper.

In addition to the features that are specific to MQTs, these tables look and function very much like standard DB2 tables. MQTs can have indexes, be queried, and contain statistics. Most of the command syntax and SQL code for regular tables and for MQTs is the same.

Why Use MQTs? Improved PERFORMANCE!!!! Consider a Decision Support System (DSS) database where queries are run that aggregate data regularly, for example, total sales over a given period for various regions. When reports are generated or queries are executed to retrieve this aggregated data, processing can take from seconds to hours each time these queries are executed. Now, you can create an MQT to support these reports and queries. The processing is performed one time to aggregate the data in the MQT.

In the preceding DSS example, all sales that were made per region per time period can be aggregated for all regions and time periods, concurrently. Now, each time a query is executed to

3

Page 6: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

request sales data for a specific region or a report is generated for all regions, the data can be read from an MQT. When DB2 provides the data by reading from the MQT instead of recalculating aggregated data repeatedly as queries execute, response time is reduced from minutes, hours, or longer to sub-second reads, in many cases. The cost of (re)processing the requests is reduced to the cost of reading the aggregated data from the MQT, and overall response time is dramatically reduced.

Later in this paper, several examples are given in which the introduction of an MQT decreases query processing from minutes to sub-seconds! As always, performance will vary based on the operating environment, hardware, configuration, amount of data, and other factors.

What Is DB2 Cube Views? DB2 Cube Views is an IBM product that extends the database into the realm of OLAP cubes and cube models. With DB2 Cube Views, the database becomes multi-dimensionally aware by including metadata support for dimensions, hierarchies, attributes, and analytical functions; by analyzing the dimensional model and recommending MQTs (also known as aggregates or summary tables) that improve OLAP performance; by adding OLAP metadata to the DB2 catalogs, which provides a foundation for OLAP that will speed deployment and improve performance; and by simplifying the exploitation of advanced DB2 technologies such as summary table management and analytical functions.

DB2 Cube Views includes its own advisor, which should not be confused with the DB2 Design Advisor. While the DB2 Design Advisor can analyze workloads and recommend database settings, it is not multi-dimensionally aware. The DB2 Cube Views Optimization Advisor is aware of the metadata (dimensions, hierarchies, levels, cubes) that is entered for the cube model, and it enables DB2 Cube Views to perform one of its most valuable functions for a SAS environment. With this metadata, the DB2 Cube Views Optimization Advisor can recommend which MQTs should be created in support of the cube model and its associated cubes by generating scripts to create and update MQTs that support reporting, drill-through or MOLAP extracts, or customized aggregations for special purposes.

Will DB2 Cube Views and MQTs Help a SAS Environment? Absolutely! While there are no explicit commands in SAS/ACCESS to support DB2 Cube Views and MQTs, you can substantially benefit from using DB2 Cube Views and MQTs in your database. The right MQTs can increase query performance dramatically. An example that is given later in this paper shows how an MQT decreased the processing time for our sample query from almost 9 minutes to 0.09 seconds! Similar performance gains are shown in other tests. Often, appropriate MQTs provide greatly increased performance for queries, ETL processes, extractions, and other tasks. Remember, while the gains are dependent on the specific application and operating environment, the number of potential uses is enormous.

The way in which you create MQTs is similar to the way that you create regular tables, as explained later in this paper. To create MQTs from within SAS, you have to use the SQL Pass-Through mechanisms of SAS/ACCESS. Otherwise, you can create any desired MQTs by using standard DB2 interfaces and SQL commands.

4

Page 7: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

After the MQTs are created, they can be accessed explicitly or implicitly. Explicit access to an MQT from SAS is the same as accessing any table; you access the MQT by name. All the traditional access methods that are used in SAS are available, subject to certain access restrictions. For example, you cannot alter data in a system-maintained MQT. (For details, see the DB2 documentation resources that are listed at the end of this paper.)

While improving performance is one of the two greatest benefits of MQTs, implicit access to them is the other. Suppose that you have a legacy application that you want to speed up by using MQTs, but you don’t want to re-write that SAS application because of the cost or the risk that’s involved. No problem. The DB2 Optimizer accesses the MQTs, automatically. All dynamic SQL queries are intercepted by the Optimizer. As part of the process of creating a data access plan for the query, the Optimizer checks any MQT that is related to the tables that are being queried to see if several conditions can be satisfied. Can the MQT satisfy all or part of the query? Is the data in the MQT sufficiently current? Is this the most efficient way to satisfy the query? If the answer is “yes”, at least to all these questions (there might be other criteria), then the DB2 Optimizer re-writes the query to access the MQT, automatically and transparently. In other words, if it makes sense to use the MQT, the Optimizer will use it. In this way, the applications and the users can benefit from the MQTs without even knowing that they are there.

While there are no direct, specific commands in SAS that support DB2 Cube Views or MQTs, both can still provide great benefits to a SAS environment. Also, remembering that MQTs can be treated in most ways as standard tables, most SAS code and commands that support regular DB2 tables will also work with MQTs.

Note: In most environments, direct access of MQTs is discouraged because administrators might drop a table without notice or the data in user-maintained MQTs might not be sufficiently current. However, in a SAS environment, an MQT might be created for a specific purpose, such as an aggregation table. If everyone knows that an MQT is being accessed directly and the risks are noted, then there should be no problem with direct access.

Using DB2 Cube Views is straightforward for developers and users who have an understanding of cube models and cubes. Metadata about any star schemas, cube models, and cubes are manually entered into DB2 Cube Views. A Quickstart wizard in DB2 Cube Views analyzes the underlying database for possible joins and other dependencies that exist in the database in order to partially build the metadata. The user or developer can then build out the remaining metadata. This will provide the foundation information for DB2 Cube Views to analyze the metadata, the cube models, the workload, and other factors, and generate scripts to create and maintain appropriate MQTs for the environment.

Both the DB2 Cube Views Optimization Advisor and the DB2 Design Advisor will suggest MQTs for your specific operating environment. It is best to use both of these features, first the DB2 Cube Views Optimization Advisor, then the DB2 Design Advisor.

Other third-party tools might be able to help import or export metadata. Meta Integration Technology, Inc. (MITI), a partner of both IBM and SAS Institute, has developed a number of metadata bridges between various companies’ products, including SAS and DB2 Cube Views. Because new and updated bridges are always under development, it is worthwhile to check MITI’s Web site for new developments at http://www.metaintegration.net.

5

Page 8: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Why Have both DB2 Cube Views and SAS OLAP Server? Why would anyone want to have both DB2 Cube Views from IBM and SAS OLAP Server products in their environment? Aren’t they redundant? Absolutely not! In fact, DB2 Cube Views can provide tremendous support for SAS OLAP Server. Combining SAS OLAP Server, DB2, and DB2 Cube Views provides a very efficient environment for data aggregation and analysis to support business decisions.

SAS OLAP Cube Studio and SAS OLAP Server have extensive capabilities, which include support of Multidimensional, Relational, and Hybrid OLAP environments (MOLAP, ROLAP, and HOLAP). These capabilities and more make these SAS components valuable additions to the SAS environment. As part of any of these OLAP environments, SAS OLAP Server might have to access the underlying data in DB2 for a number of reasons.

For example, an OLAP Cube that’s created in SAS OLAP Cube Studio might have been deliberately designed with top-level slices or accumulations of data, or it might only contain data down to specific cutoff levels for particular dimensions. (Usually, this is done for performance reasons or to limit the volume of data that’s held in SAS.) In this scenario, a cube might not hold accumulations at all levels for all dimensions. Accumulations below the cutoff levels will be called up from the DB2 database by SAS. When this happens, these aggregations might be kept temporarily resident in the SAS OLAP data store indefinitely, or they might be purged in a short time. For an environment such as this, MQTs can aggregate data at the lower levels and hold the aggregations in the database. Any drill-through queries that need to access the data from the database will be re-routed to the MQTs for maximum performance. In other cases, SAS OLAP Server might aggregate data and retain it in a more permanent form in a SAS data store, especially in support of a MOLAP data store.

In each of these scenarios, SAS OLAP Server must access the underlying data in the DB2 database—in the first scenario, to build data in response to ad hoc queries that are not in a permanent data store and, in the latter scenario, to periodically refresh the OLAP data that’s held in SAS. In all these scenarios, queries might still drill through the levels of the SAS OLAP model and require a query of the underlying database. MQTs can aggregate data at any level, both above and below the cutoff level that is specified in the SAS OLAP Server to support faster execution of ad hoc queries or full data refreshes of the SAS OLAP cubes.

DB2 Cube Views can design Materialized Query Tables to support all these queries by SAS OLAP Server. By inputting the metadata that describes a star schema and related information, DB2 Cube Views will design a near-optimal set of MQTs that maximizes the coverage while minimizing the number of MQTs that need to be created. This helps to minimize the maintenance that is required for the MQTs. After the MQTs are created and populated, they can support the vast majority of queries from SAS OLAP Server that require aggregated data and provide a dramatic reduction in response time. As an extra benefit, the DB2 Optimizer automatically intercepts all dynamic queries that are submitted to DB2 and re-routes them to MQTs whenever there is a performance benefit, thus eliminating any need to re-write queries in SAS.

It’s important to make sure that the cube model and its components are described as identically as possible to SAS OLAP Server and to DB2 Cube Views in order to get the greatest benefits. After

6

Page 9: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

this is done, DB2 Cube Views can provide the scripts to build and refresh MQTs with highly efficient data aggregations to support any SAS OLAP Cubes. In turn, SAS OLAP Server extracts pre-aggregated data from the MQTs and provides a very powerful tool and resource that gives users the kind of analytics and summary information that they expect.

How to Use MQTs The beauty of MQTs is that a user doesn’t even need to know that they exist in order to use them! When a dynamic SQL query is submitted (all SAS queries are dynamic), the DB2 Optimizer examines the query, the related tables, and any MQTs that are based on those tables. If the Optimizer determines that an MQT can answer the query at a lower processing cost, it automatically re-writes the query to use the MQT instead of all or some of the base tables. The DB2 Optimizer handles it, transparently, without requiring special commands or changes to the application code.

Of course, an MQT is just a table and can be directly accessed by name. In this case, the DB2 Optimizer always accesses the MQT because it is explicitly requested. However, this is discouraged because, when direct dependencies are created on any MQTs by query tools, the ability of developers and system administrators to drop, alter, or otherwise refine these MQT tables is restricted. The exception is when MQTs are created to support a specific aggregation that is identified to SAS OLAP Server.

Creating MQTs You can create MQTs by using the same CREATE TABLE command as you use for regular tables, but you have to include specific clauses for MQTs. To create an MQT, a user must be granted permission to create tables. At most sites, for maintenance reasons, creating tables is restricted to developers and administrators, so talk to your system administrator. For details about creating tables, see the DB2 documentation resources that are listed at the end of this paper.

This first example shows a CREATE TABLE command for an MQT that contains “bad accounts” based on having a status of Delinquent, Problematic, or Hot. By creating this MQT, a list of bad accounts is maintained. This list eliminates the need to recalculate, during subsequent queries, whether an account is bad. Because the processing to calculate whether an account is bad has already been performed, the DB2 Optimizer re-writes each subsequent query to read the data from the MQT instead of recalculating the result from the base tables.

The DB2 SQL syntax is sent to DB2 by using explicit SQL Pass Through. The DB2 SQL syntax is contained in parenthesis following the keyword EXECUTE.

proc sql; connect to db2 (db=<database> user=<userid> using=<password>);

execute ( CREATE TABLE bad_account AS (SELECT stomer_name, customer_id, a.balance cu FROM account a, customers c WHERE status IN ('delinquent','problematic', 'hot') AND a.customer_id = c.customer_id )

7

Page 10: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment DATA INITIALLY DEFERRED REFRESH DEFERRED ) by db2; disconnect from db2; quit;

The syntax is very similar to that used to create a regular table. The AS clause describes the query that is the basis of the table. Now, look at the last two clauses in the CREATE statement, which is shown in boldface. These two clauses control when and how the MQT is populated. DATA INITIALLY DEFERRED tells DB2 not to populate the table at creation time. REFRESH DEFERRED tells DB2 that the data is only to be updated when a REFRESH TABLE statement is issued. Alternatively, REFRESH IMMEDIATE will cause any changes in base table data to be propagated to the MQT immediately.

Note: LOAD processes do not automatically refresh data in MQTs. Instead, tables are placed in a check-pending state. See the DB2 documentation resources that are listed at the end of this paper for the exact behavior and to find out which procedures to use based on the particular situation.

Create Better MQTs – A Tale of Two Advisors Usually, creating MQTs is a task that is best suited for developers and database administrators or someone who has a good working knowledge of the database. Although MQTs can be created manually, it can be a time-consuming process to analyze a given environment and design optimal MQTs for a given combination of workload and resources. Creating MQTs requires intimate knowledge of the query workload, the resources, the design of the database and of any star schemas, the cube models, and other items that are contained in the database. Wouldn’t it be better if there were a tool to help with this analysis? In fact, there are two tools, the DB2 Design Advisor and DB2 Cube Views.

DB2 Design Advisor The DB2 Design Advisor, which is included with DB2, is a query workload-based advisor. Beginning with DB2 V8.2, the DB2 Design Advisor can make recommendations regarding indexes, Multidimensional Clustering (MDC), partitioning, and MQTs for your database. The DB2 Design Advisor analyzes the database for a given workload, configuration and resources, data statistics, and so on. It also can be a powerful optimization tool. Given an appropriate workload and accurate statistics as input, the DB2 Design Advisor can recommend new MQTs, changes to existing MQTs, and removal of obsolete MQTs that are no longer of value. DB2 Design Advisor recommendations are based on the existing database design and structure, configuration, tables and table statistics, and workloads that are submitted to it. However, it does not consider multidimensional aspects of a star schema or cube model that might be embedded in the database.

DB2 Cube Views DB2 Cube Views takes a giant step forward for DSS environments. While DB2 Design Advisor is query-workload based, DB2 Cube Views has a model-based advisor. DB2 Cube Views goes further and analyzes the relationships that exist in a star or a snowflake model in the database—the dimensions, hierarchies, levels, measures and facts and their relationships, based on the metadata that’s entered into the DB2 Cube Views product. This analysis is combined with human

8

Page 11: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

input, which describes the resources that can be used, especially the maximum disk space and analysis time that’s allowed, and whether the goal is to support drill-through queries, report generation, multidimensional OLAP, and so on. The DB2 Cube Views Optimization Advisor then generates two sets of DDL scripts: one script to produce and one script to maintain an optimized set of MQTs for the environment.

With unlimited resources, MQTs can be created for every possible aggregation of data, but the overhead and maintenance might be a burden. To balance resources and overhead against creating MQTs to support known or expected queries, it is best to create a minimal set of MQTs to support a target workload. Frequently, one or a few “superset” MQTs can be created that will support multiple queries that are similar, rather than individual MQTs for each query in the workload. A superset MQT contains more columns than are needed for one query, but it supports several queries at one time. The reasoning is that it’s better to maintain one broader MQT than several smaller MQTs that have common columns. DB2 Cube Views Design Advisor follows this logic in making its recommendations.

DB2 Version 8.2 Improvements Under Version 8.1 of DB2 and DB2 Cube Views, the DB2 Optimizer used an MQT only if it contained all the columns that were needed to satisfy a query. In Version 8.2 of DB2 Cube Views, functional dependencies between columns in the same table are identified in the metadata. You can think of this as referential integrity (RI) in the same table, without the update/insert/delete overhead of RI. These functional dependencies are informational to the system but are not enforced. Because of this, an MQT is now used if all columns that are needed are either in the MQT or are identified by one of these functional dependencies. In the latter case, the required data is retrieved from the base table and referenced by the row ID that’s supplied from the MQT.

With this enhancement, the row size of MQTs can be reduced. For example, a large field (such as a description field of type VARCHAR(200)) can be associated with a short, product ID field. This association makes it possible to leave the longer VARCHAR field out of the MQT but makes the data efficiently accessible from the base table.

The Version 8.1 DB2 Design Advisor was only capable of suggesting indexes. In Version 8.2, the DB2 Design Advisor was enhanced to make recommendations for indexes, Multidimensional Clusters (MDCs), and MQTs. In a multi-mode environment, the DB2 Design Advisor also makes partitioning recommendations for regular tables and MQTs.

Which Advisor Should I Use? Both! Each of these Advisor wizards has its strong points, but, in early testing, the combination of the two Advisors appears to be even better. The DB2 Cube Views Optimization Advisor designs MQTs in support of OLAP objects like star schemas and cube models, and the DB2 Design Advisor designs MQTs for existing structure, specific workload, and known statistics.

Much of the information in this section is based on research and on the contents of a separate white paper “DB2 and DB2 Cube Views Best Practices for MQT Design Using Model-Based and Workload-Based Advisors” by Virginia Hoffman, IBM. (Publication is scheduled for 2005.) For a more detailed explanation of the research and results, see the aforementioned white paper.

9

Page 12: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Use the DB2 Cube Views Optimization Advisor, First! Advisor execution order is important in controlling resource usage. By using the DB2 Cube Views Optimization Advisor to generate MQT scripts, and creating these MQTs before running the DB2 Design Advisor to create additional MQTs, the number and size of the MQTs that are created is kept to a minimum.

A case study was performed with the following criteria:1

• Given 3 Major components: o A DB2 Cube Views Model against a real customer’s schema o Data from the customer o A query workload of 57 queries representing ad-hoc queries

Count, Sum, Division, Avg, Min, Max, Distinct, Count Distinct Group By, Group By Cube, Group By Rollup, Having,

Select using Temporary Table • Facts:

o Fact table has 1,036,628 rows o DB2 Cube Views Query Type: Reporting o DB2 Cube Views Measures: Count, Sum

• Run the two Advisors in different orders and combinations to determine how they best

complement each other Results from this case study are shown in Table 1.

# Queries

routed to MQTs

# MQTs MQT Size KB MQT # Rows

DB2 Cube Views Only

22 of 57 1 22,656 136,509

DB2 Design Advisor Only

16 of 57 10 1856 7957

DB2 Cube Views first then DB2

30 of 57 6 25,888 156,430

DB2 first then DB2 Cube Views

25 of 57 11 24,224 144,466

Table 1: Effect of Order of Advisor Execution

By running the DB2 Cube Views Optimization Advisor first, which creates the recommended superset, model-aware MQTs, and then running the DB2 Design Advisor, it was possible to support the same workloads using 5 less MQTs, which reduced the amount of maintenance that was required. Yet, the DB2 Optimizer re-routed queries to the MQTs 5 more times or 20% more often than if the order had been reversed. The number of queries that were re-routed is even lower if only one of the Advisors is used.

Note: It is possible that the DB2 Design Advisor will recommend deleting MQTs that were created based on the DB2 Cube Views Optimization Advisor recommendations. Delete these MQTs cautiously. Remember that the DB2 Design Advisor looks for obsolete MQTs, but it is not cube

1 These test results are from work that’s described in the upcoming white paper "DB2 and DB2 Cube Views Best Practices for MQT

Design Using Model-Based and Workload-Based Advisors", by Virginia Hoffman, IBM. (Publication is planned for 2005.) However, these results might not reflect your specific environment or application.

10

Page 13: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

model aware. To know if a specific MQT should be deleted, you need to track its usage. If an MQT is not being accessed, then it is probably okay to delete it. However, it’s important to make sure that the MQT isn’t being used for critical work.

Tips for Influencing the DB2 Cube Views Optimization Advisor

The DB2 Cube Views Optimization Advisor generates MQTs based on the cubes that are constructed. These MQTs are based on internal heuristics and on any specific overrides that you might create. The internal heuristics are based on business rules, hierarchies, reports, query types, and the analysis and common usage of cubes. Let’s look at how this works.

When creating or editing cubes in DB2 Cube Views (that is, DB2 OLAP Center), you have to identify the query type; the standard choices are Drill-down, Report, MOLAP Extract, and “Advanced Settings”. These choices are found on the Query Type tab in the Cube Properties Window. When one of the three standard choices is selected, the DB2 Cube Views Optimization Advisor analyzes the database and builds MQTs based on the heuristics that are embedded in the software. This means that, for a given query type and the selected hierarchies in the cube model, the resulting MQT might drill down to the bottom level, an intermediate level, or only aggregate to the top-most level in the hierarchy. The level of the drill down depends significantly on the query type.

What does this have to do with the MQT? You might find that an MQT that’s recommended by the DB2 Cube Views Optimization Advisor isn’t being used by one or more queries in your workload. However, one of these queries is for a critical report, and you need an MQT to support that report. When an MQT isn’t being used by a query, it might mean that the query needs to drill down to a hierarchy level that’s below the bottom level that’s contained in the MQT. For example, a query might need data from the ‘Day’ level of a TIME hierarchy, where the MQT only descends to the ’Month’ level. In this case, the DB2 Optimizer finds the deficiency and ignores the MQT in favor of the base tables.

The solution is in the fourth choice on the Query Type tab—Advanced Settings. Click the “Specify…” button to access the Optimization Slices window, which displays a graphic representation of the cube that shows all the hierarchies and the levels that are contained in them. The hierarchies are listed, vertically, from top to bottom. Also, there is a dotted line at the bottom of each hierarchy that leads to the level named “Any”. The “Any” level tells DB2 Cube Views to use its internal heuristics to select an appropriate level. Conversely, moving a slider up to another level forces a selection of that level.

If you have a query that needs to use an MQT but it doesn’t, then analyze the query and compare it to the MQT. If you find a hierarchy in the MQT that isn’t sufficiently deep enough to satisfy the query, use the technique that’s described in the previous paragraph to force the inclusion of the missing level. This technique can also be used to create an MQT that’s designed specifically for a given query that must execute quickly.

Note: Using this method to force selection of the bottom-most levels of all hierarchies might be very useful, or it’s possible that the performance will be the same as that of having no MQT and using the base tables themselves. Consider this when influencing the Advisor in this way.

11

Page 14: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

A Word about Test Procedures It should be noted that testing was done more in the spirit of proof-of-concept than as a full-blown benchmark. No part of the environment (including SAS, DB2, or Windows) was optimally tuned. In fact, wherever possible, default values were used. Some basic tuning was performed on DB2 by letting DB2’s auto-configuration function execute by using the command db2 autoconfigure. The result is documented in Appendix A.

During the testing process, each test was executed several times, the test order was mixed, and the test was run under various states. Some of these states included rebooting the computer between runs, stopping and re-starting DB2, SAS OLAP Server, or both, or by making no changes. The test order was sometimes reversed; the tests were run with an MQT then the MQT was deleted, and the baseline test was run.

Testing in these various scenarios was performed to reveal any impact from caching, first query costs, and any patterns of performance that were related to the sequence of execution. At minimum, each test was executed twice in succession, without any changes to the environment, to try to find any significant changes in execution time under each set of test conditions relative to changes in execution time that were due to intentional changes, for example, adding or removing an MQT table or registering the aggregation/MQT with SAS OLAP Server.

While there were variations in execution times for tests that were run under each given set of conditions, these variations were small relative to the changes in performance that were due to the intentional test condition changes. Test results were consistent, with a reasonable variation on equivalent runs.

Performance Test: A Simple MQT Example

Environment for First Test Computer: Intel 2.66 Ghz. x 4 processors 1 GB RAM 60 GB disk space O/S: Windows XP Professional 5.1.2600 DB2: DB2 UDB Version 8.1 Fixpack 4 32-bit Database: See Appendix A for DDL

Simple MQT Example During standard testing of the SAS OLAP Server, an implicit query was used to evaluate the performance of an MQT. Captured and coded as below, the query was explicitly run twice in SAS and the timing data was captured.2 In one test, the query was executed without an MQT. For the other test, an MQT was created, based on the query. The MQT was updated and the timing data was then captured. Notice that the query itself was not altered between runs.

2 For testing purposes, several runs were executed for each of the two scenarios in order to verify repeatable results, and verify that

there was little or no impact from the first run versus repeat runs, data caching, and so on.

12

Page 15: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

This test uses a very simple MQT; an aggregation based on columns from a single table. This test was deliberately kept simple to show the impact of pre-aggregating data in an MQT. In a more complex scenario, the MQT would represent data that is joined between several tables and aggregated. The performance impact of running the query against multiple base tables would be higher than that of running the query against a single base table, thereby increasing the overall benefit of an MQT.

LIBNAME DB2LOCAL DB2 PRESERVE_COL_NAMES=YES PRESERVE_TAB_NAMES=YES DATASRC=sample SCHEMA=DBIADMIN USER=dbiadmin PASSWORD=******** ; options sastrace=',,,sd' sastraceloc=saslog nostsuffix; proc sql dquote=ansi; select "CD3L4MEDBIG"."D1L1", "CD3L4MEDBIG"."D1L2", "CD3L4MEDBIG"."D1L3", "CD3L4MEDBIG"."D1L4", "CD3L4MEDBIG"."D2L1", "CD3L4MEDBIG"."D2L2", "CD3L4MEDBIG"."D2L3", "CD3L4MEDBIG"."D2L4", SUM("CD3L4MEDBIG"."N1") as SUM_N1, SUM("CD3L4MEDBIG"."M1") as SUM_M1 from DB2LOCAL."CD3L4MEDBIG" where ("CD3L4MEDBIG"."D1L1" = ' 1') and ("CD3L4MEDBIG"."D1L2" = ' 1') and ("CD3L4MEDBIG"."D1L3" in (' 1',' 2',' 3',' 4')) and ("CD3L4MEDBIG"."D2L1" = ' 1') and ("CD3L4MEDBIG"."D2L2" = ' 1') and ("CD3L4MEDBIG"."D2L3" in (' 1', ' 2',' 3',' 4')) and ("CD3L4MEDBIG"."D3L1" = ' 1') and ("CD3L4MEDBIG"."D3L2" = '1') group by "CD3L4MEDBIG"."D1L1","CD3L4MEDBIG"."D1L2", "CD3L4MEDBIG"."D1L3","CD3L4MEDBIG"."D1L4", "CD3L4MEDBIG"."D2L1","CD3L4MEDBIG"."D2L2", "CD3L4MEDBIG"."D2L3","CD3L4MEDBIG"."D2L4"; quit;

In this test, the SAMPLE database that’s provided with DB2 was used as the starting point. The default bufferpools, tablespaces, and database and database manager settings were used. No tuning was performed on DB2 or on the database. A number of tables were then added to the database, as part of the test plan.

The MQT table CD3L4MEDBIG_MQT in the SAMPLE database is based on a single base table, CD3L4MEDBIG. The first 8 columns of the MQT are copies of the same 8 columns in the original table. The remaining 2 columns accumulate a total sum of the N1 and M1 columns for all rows that have the same distinct values for the first 8 columns. This is accomplished with the SUM function in combination with the GROUP BY clause. The rows that are selected are based on the WHERE clause that examines 6 of the first 8 columns plus 2 additional columns from the base table, and filters the data by selecting only specific values.

13

Page 16: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

The MQT was created by using the following DDL.

------------------------------------------------ -- DDL Statements for table "DBIADMIN"."CD3L4MEDBIG_MQT" ------------------------------------------------ create table DBIADMIN.CD3L4MEDBIG_MQT as

(select DBIADMIN."CD3L4MEDBIG"."D1L1", DBIADMIN."CD3L4MEDBIG"."D1L2", DBIADMIN."CD3L4MEDBIG"."D1L3", DBIADMIN."CD3L4MEDBIG"."D1L4", DBIADMIN."CD3L4MEDBIG"."D2L1", DBIADMIN."CD3L4MEDBIG"."D2L2", DBIADMIN."CD3L4MEDBIG"."D2L3", DBIADMIN."CD3L4MEDBIG"."D2L4", SUM(DBIADMIN."CD3L4MEDBIG"."N1") as SUM_N1, SUM(DBIADMIN."CD3L4MEDBIG"."M1") as SUM_M1

from DBIADMIN."CD3L4MEDBIG" where (DBIADMIN."CD3L4MEDBIG"."D1L1" = ' 1')

and (DBIADMIN."CD3L4MEDBIG"."D1L2"= ' 1') and ( DBIADMIN."CD3L4MEDBIG"."D1L3" in (' 1', ' 2', ' 3', ' 4')) and (DBIADMIN."CD3L4MEDBIG"."D2L1" = ' 1') and (DBIADMIN."CD3L4MEDBIG"."D2L2" = ' 1') and ( DBIADMIN."CD3L4MEDBIG"."D2L3" in (' 1', ' 2', ' 3', ' 4')) and (DBIADMIN."CD3L4MEDBIG"."D3L1" = ' 1') and (DBIADMIN."CD3L4MEDBIG"."D3L2" = '1')

group by DBIADMIN."CD3L4MEDBIG"."D1L1",

DBIADMIN."CD3L4MEDBIG"."D1L2", DBIADMIN."CD3L4MEDBIG"."D1L3", DBIADMIN."CD3L4MEDBIG"."D1L4", DBIADMIN."CD3L4MEDBIG"."D2L1", DBIADMIN."CD3L4MEDBIG"."D2L2", DBIADMIN."CD3L4MEDBIG"."D2L3", DBIADMIN."CD3L4MEDBIG"."D2L4") DATA INITIALLY DEFERRED REFRESH DEFERRED

ENABLE QUERY OPTIMIZATION NOT LOGGED INITIALLY;

Refresh table cd3l4medbig_mqt; Table 2 shows a listing of the test tables and the cardinality or row count for each.

Table Row Count

CD3L4MEDBIG 64,000,000

CD3L4MEDBIG_MQT 1600 Table 2 Cardinality of Base Table and MQT

14

Page 17: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Results Implementing an MQT for this query had dramatic results (Table 3). A query that normally takes almost 9 minutes now executes in less than 1/10 of a second! That means that after the MQT is populated or refreshed each subsequent execution will save almost 9 minutes elapsed time to complete.

Results from SAS Execution Query without MQT Query Using MQT

Summary Statistics for DB2: Total SQL prepare seconds: 0.000020 0.000019 Total SQL describe seconds: 0.000219 0.000222 Total seconds used by the DB2 ACCESS engine:

0.007350 0.003679

Total row fetch seconds: 0.008613 0.007470 Total SQL execution (seconds): 526.012003 0.001231

Total SQL prepare seconds: 0.000041 0.000041 Total SQL describe seconds: 0.002909 0.000195 Total seconds used by the DB2 ACCESS engine:

526.110484 0.094683

NOTE: PROCEDURE SQL used (Total process time):

real time 526.12 sec (8 min, 46.12 sec)

0.09 sec

CPU time 0.09 seconds 0.07 seconds

Table 3. Test Results - SAS Usage of a DB2 Materialized Query Table

In this example, execution of the REFRESH TABLE command took almost 9 minutes (or, roughly, the time it takes to execute the query on which it is based). This is a full refresh of the table after being created. Depending on the philosophy that’s used in creating the table, the cost of maintaining the MQT will vary. For example, in a daily, batch-run scenario, the cost of maintaining the MQT would be a once-per-day event. Creating a staging table for incremental changes can substantially reduce the time that it takes to refresh the MQT. If the table is created using REFRESH IMMEDIATE, then the table would always be current. However, this benefit comes at the cost of updating every time the underlying base table data changes.

As an additional test, to show the behavior in a pure DB2 environment, the following queries were run from a DB2 command window on the same system. The base table query was run before the MQT was created. The results (Table 4) closely approximate the scenario of the preceding example test.

15

Page 18: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment Db2 select * from cd3l4megbig where d1l1 like ‘%1’

and d1l2 like ‘%1’ and d1l3 like ‘%1’ and d1l4 like ‘%8’ and d2l1 like ‘%1’ and d2l2 like ‘%1’ and d2l3 like ‘%3’ and d2l4 like ‘%2’;

Db2 select * from cd3l4megbig_MQT where d1l1 like ‘%1’

and d1l2 like ‘%1’ and d1l3 like ‘%1’ and d1l4 like ‘%8’ and d2l1 like ‘%1’ and d2l2 like ‘%1’ and d2l3 like ‘%3’ and d2l4 like ‘%2’;

DB2 Raw Query Elapsed Time (approx) Row Count

Db2 select * from cd3l4megbig where…

9 mins 64,000,000

Db2 select * from cd3l4megbig_MQT where…

< 1 second 1,600

Table 4. Native DB2 Query – Times of Execution

Performance Test: DB2 Cube Views Support of a SAS OLAP Cube Now that the power of MQTs has been demonstrated, it’s time to take a leap forward, and show what happens when a cube model and an associated star schema are described in SAS OLAP Cube Studio and in DB2 Cube Views.

Environment for Second Test Computer: Intel 2.0 Ghz. single processor 512 MB RAM 38 GB disk space on one drive O/S: Windows XP Professional Service Pack 1 DB2: DB2 UDB Version 8.1 Fixpack 7 32-bit (Equivalent to DB2 V.8.2) DB2 Cube Views Version 8.2 Database: See Appendix A for DDL and other Appendices as noted in text

16

Page 19: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Database The core of the database is composed of one Fact Table and five Dimension Tables. Fact Table: SPSALALL Dimension Tables:

SDPROD Product data SDCUST Customer data SDTIME Time data (Year, Quarter, Month, Week, Day) SDPROMO Promotion data SDTERMS Terms (cash, check, credit card)

For testing purposes, the following was done in the database:

• NULLS were not allowed. Every column was set as NOT NULL. In practice, only specific columns require this under DB2 Cube Views. Those columns are related to joins, levels, hierarchies, and other items.

• PRIMARY KEYS were added. Each Dimension Table had an ID column that was set as a primary key in support of joins in the cube model.

• FOREIGN KEYS were added. The Fact Table had a foreign key added that pointed to each of the primary keys in the Dimension Tables in support of joins in the cube model.

Cube Model The Cube Model is described in Appendix B which contains a file that can be imported into SAS OLAP Cube Studio to generate the Cube Model.

For DB2 Cube Views, the Cube Model metadata was partially generated from the database by using the DB2 Cube Views wizard. Specifically, the joins were discovered based on the foreign keys in the database. The remaining data was manually entered by using the DB2 OLAP GUI, based on the information in the file in Appendix B. Specifically, the measures, hierarchies, and levels must be manually entered. Lastly, the DB2 Cube Views Optimization Advisor was executed on the model. The purpose of the desired MQTs was described as CUSTOM, a slice was selected as the bottom level of each of the three dimensions—Product, Time, and CustSex—and the MQTs were generated. The resulting product was exported and is shown in Appendix C.

Description of Tests Two tests, which are representative of work in an OLAP environment, were selected from a test suite for this research. The first test was typical of most of the tests in the test suite. The second test was a more extensive test that spanned more data and was also the longest running test. Both tests can be examined in Appendix D.

Test OLMDGB4P is a basic MDX function test that executes an extract, cross-joins data, and aggregates a top-count sum on the measures.

Test OLMDGB5H is a more extensive test that generates order tuples. This is a much broader data extraction and compilation.

17

Page 20: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Test Procedure Testing consisted of three phases for each test, and for each test, scenario, and phase, at least two runs were always executed. Here are the three phases that were used for the tests.

A baseline test was run to establish run times for a standard SAS with DB2 environment.

The single MQT table that was recommended by DB2 Cube Views was created and populated. The test was then executed again.

The MQT was registered as an aggregation in SAS OLAP Server and each test was executed again.

During testing, the process was also reversed, thus validating the consistency of the test results.

Results of Tests The test results are striking (Table 5). DB2 Cube Views was able to design a single MQT to support both tests. After the MQT was created and populated, DB2 was able to accelerate test performance and reduce execution times over 80% by intercepting queries from SAS and re-writing them to use the new MQT. This benefit was obtained with no changes to the SAS environment.

In the next phase, the SAS OLAP Cube was changed, by telling SAS OLAP Server that the MQT was available, that is, by adding an accumulation to the SAS model. This action reduced execution time to less than 2% of the baseline execution times that were observed in repeated runs! (Remember, your mileage might vary based on your operating environment and other site-specific factors.) This improvement was the direct result of caching by SAS OLAP Server. When caching was disabled, run times with an MQT were consistent whether the MQT was registered as an aggregation or not.

Maximum performance is obtained when caching is active in the SAS OLAP Server, and the MQTs are registered as aggregation tables.

Test name Run description

Total Execution Times (seconds)

Runtime ( % of baseline, using averages)

Worst Best Average olmdgb4p baseline run 25.953 20.973 23.463 100.00%

Created and loaded MQT table MQT1 3.391 2.406 2.898 12.35%

aggregation registered in SAS OLAP 0.500 0.219 0.359 1.53%

olmdgb5h baseline run 165.587 155.184 160.385 100.00%

Created and loaded MQT table MQT1 18.484 12.594 15.539 9.69%

aggregation registered in SAS OLAP 2.391 1.969 2.180 1.36%

Table 5 Test Execution Times with and without DB2 Cube Views MQTs

18

Page 21: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Conclusions

DB2 MQTs and DB2 Cube Views Improve Performance Materialized Query Tables (MQTs) provide a way to pre-aggregate data in a DB2 database. SAS users and SAS applications can leverage this benefit by reducing query processing times for tasks such as generating reports, conducting analyses, and performing ETL processes. The data is already pre-aggregated, so computational time at the database level is minimized.

DB2 Cube Views (which is a model-based advisor and MQT development application) in combination with the DB2 Design Advisor (which is a workload-based advisor that’s provided with DB2) can be used to greatly enhance the efficiency of MQT design and maintenance and resource use.

SAS supports MQTs, in that it supports DB2 tables in general. There is no explicit code in SAS/ACCESS for MQTs or DB2 Cube Views because most of the work occurs transparently in DB2. This means that all these tools can greatly benefit SAS users and environments, right now, by reducing throughput times and dramatically increasing performance.

SAS OLAP Server and SAS OLAP Cube Studio Use MQTs and DB2 Cube Views Two significant levels of benefit can be obtained from the use of Materialized Query Tables (MQTs) and DB2 Cube Views. The first level is obtained when MQTs are created. With no changes to the SAS environment, big improvements in performance occur when the DB2 Optimizer intercepts queries that are submitted and re-writes them to use the MQTs. The result is a substantial reduction in query execution times.

The second level of benefit is accomplished when the administrator informs SAS OLAP Server about the MQTs. SAS OLAP Server queries the database by accessing registered aggregation tables (MQTs) with more efficient queries, which reduces processing time by another quantum leap.

Implementing both techniques will provide the maximum benefit. SQL query execution times should be reduced dramatically.

Summary Maximum benefit is obtained by implementing a combination of SAS OLAP Server, SAS OLAP Cube Studio, and DB2 Cube Views from IBM. Using these products and tools in combination produces performance levels that are impressively better than the performance from any one product or tool when used alone.

Disclaimer: While reductions in execution times of 95% or more have been demonstrated in these tests, the improvements in a specific environment can vary greatly based on site-specific factors such as workload, database and cube model design, implementation, and tuning levels, to name just a few. Your results will depend on your implementation.

19

Page 22: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Appendix A: DDL for Creating Test Database The following DDL will re-create the test database that was used in testing. While some tables were not actively used in the testing that’s described in this document, the DDL for those tables was left in place to accurately describe the database as it was used in testing.

Database and DBM Configuration The default DB2 configuration values for Database and Database Manager configurations were used, except for those values that were changed by the following commands:

db2 create db cv autoconfigure using workload_type complex admin_priority performance num_local_apps 5 num_remote_apps 25 bp_resizeable yes apply db and dbm db2 connect to cv db2 update db cfg for cv using logfilsiz 16384 logprimary 10 logsecond 40

DDL for Creating Tables -- THIS CLP FILE WAS CREATED USING DB2LOOK VERSION 8.2 -- TIMESTAMP: 12/16/2004 8:02:39 PM -- DATABASE NAME: CV -- DATABASE MANAGER VERSION: DB2/NT VERSION 8.2.0 -- DATABASE CODEPAGE: 1252 -- DATABASE COLLATING SEQUENCE IS: UNIQUE CONNECT TO CV; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU "."SALESTABLE" ------------------------------------------------ CREATE TABLE "CLBROU "."SALESTABLE" ( "MEDIA" VARCHAR(50) not null , "PROMO" VARCHAR(50) not null , "TERM" VARCHAR(25) not null , "FAMILY" VARCHAR(25) not null , "CATEGORY" VARCHAR(25) not null , "SUBCATEGORY" VARCHAR(25) not null , "BRAND" VARCHAR(50) not null , "SKU" VARCHAR(64) not null , "REGION" VARCHAR(25) not null , "QTY" DOUBLE not null , "TOTAL" DOUBLE not null , "SEX" VARCHAR(1) not null , "EDUCATION" VARCHAR(16) not null , "MVHHCODE" VARCHAR(2) not null , "STATE" VARCHAR(2) not null , "CUSTIDENTITY" VARCHAR(12) not null , "FULLNAME" VARCHAR(52) not null , "N_KIDS" VARCHAR(3) not null , "MARRIED" VARCHAR(1) not null , "YEAR" VARCHAR(4) not null , "QUARTER" VARCHAR(8) not null , "MONTH" VARCHAR(8) not null , "DAY" VARCHAR(11) not null , "CITY" VARCHAR(50) not null ) IN "USERSPACE1" ;

20

Page 23: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU "."SDCUST" ------------------------------------------------ CREATE TABLE "CLBROU "."SDCUST" ( "CITY" VARCHAR(50) not null , "REGION" VARCHAR(25) not null , "REGION_ID" VARCHAR(4) not null , "REGION_NAME" VARCHAR(25) not null , "STATE_NAME" VARCHAR(2) not null , "ZIPCODE" VARCHAR(5) not null , "CITY_ID" DECIMAL(11,0) not null , "CITY_NAME" VARCHAR(50) not null , "STATE" VARCHAR(2) not null , "CUST_ID" DECIMAL(11,0) not null primary key , "CUST_IDENTITY_CODE" VARCHAR(12) not null , "LOCALE_ID" DECIMAL(11,0) not null , "CUST_FNAME" VARCHAR(25) not null , "CUST_LNAME" VARCHAR(25) not null , "SEX" VARCHAR(1) not null , "MARRIED" VARCHAR(1) not null , "N_KIDS" VARCHAR(3) not null , "NUM_MVHHCODE" DECIMAL(11,0) not null , "EDUCATION" VARCHAR(16) not null , "FULL_CITY" VARCHAR(54) not null , "CUSTIDENTITY" VARCHAR(12) not null , "MVHHCODE" VARCHAR(2) not null , "FULLNAME" VARCHAR(52) not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU "."SDPROD" ------------------------------------------------ CREATE TABLE "CLBROU "."SDPROD" ( "FAMILY" VARCHAR(25) not null , "CATEGORY" VARCHAR(25) not null , "SUBCATEGORY" VARCHAR(25) not null , "BRAND" VARCHAR(50) not null , "SKU" VARCHAR(64) not null , "PROD_FAMILY_ID" DECIMAL(11,0) not null , "FAMILY_NAME" VARCHAR(25) not null , "PROD_CATEGORY_ID" DECIMAL(11,0) not null , "CATEGORY_NAME" VARCHAR(25) not null , "PROD_SUBCATEGORY_ID" DECIMAL(11,0) not null , "SUBCATEGORY_NAME" VARCHAR(25) not null , "PROD_BRAND_ID" DECIMAL(11,0) not null , "BRAND_NAME" VARCHAR(50) not null , "MANUF_ID" DECIMAL(11,0) not null , "MANUF_NAME" VARCHAR(32) not null , "PROD_SKU_ID" DECIMAL(11,0) not null primary key , "PROD_MANUF_BRAND_ID" DECIMAL(11,0) not null , "PROD_SKU_NAME" VARCHAR(50) not null , "SHIPWEIGHT" DOUBLE not null , "PROD_SKU_ALT_NAME" VARCHAR(64) not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU "."SDPROMO"

21

Page 24: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment ------------------------------------------------ CREATE TABLE "CLBROU "."SDPROMO" ( "MEDIA" VARCHAR(50) not null , "PROMO" VARCHAR(50) not null , "PROMO_ID" INTEGER not null primary key , "PROMO_NAME" VARCHAR(50) not null , "MEDIA_ID" INTEGER not null , "MEDIA_NAME" VARCHAR(50) not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU "."SDTERMS" ------------------------------------------------ CREATE TABLE "CLBROU "."SDTERMS" ( "TERM" VARCHAR(8) not null , "TERM_ID" DECIMAL(11,0) not null primary key , "TERM_DESC" VARCHAR(25) not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU "."SDTIME" ------------------------------------------------ CREATE TABLE "CLBROU "."SDTIME" ( "YEAR" VARCHAR(4) not null , "MONTH" VARCHAR(8) not null , "QUARTER" VARCHAR(8) not null , "DAY" VARCHAR(11) not null , "DAY_ID" DECIMAL(11,0) not null primary key , "DAY_DATE" DATE not null , "DAY_NAME" VARCHAR(12) not null , "DAYOFWEEK_NAME" VARCHAR(12) not null , "DAYOFWEEK_ID" DECIMAL(11,0) not null , "WEEK_ID" DECIMAL(11,0) not null , "WEEK_DESC" VARCHAR(12) not null , "MONTH_ID" DECIMAL(11,0) not null , "MONTH_NAME" VARCHAR(12) not null , "QUARTER_ID" DECIMAL(11,0) not null , "QUARTER_NAME" VARCHAR(12) not null , "YEAR_ID" DECIMAL(11,0) not null , "YEAR_NAME" VARCHAR(12) not null , "WEEK_OF_YEAR_ID" DECIMAL(11,0) not null , "MONTH_OF_YEAR_ID" DECIMAL(11,0) not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU "."SPSALALL" ------------------------------------------------ CREATE TABLE "CLBROU "."SPSALALL" ( "DATE_ID" DECIMAL(11,0) not null , "CUST_ID" DECIMAL(11,0) not null , "PROD_ID" DECIMAL(11,0) not null , "TERMS_ID" DECIMAL(11,0) not null , "PROMO_ID" DECIMAL(11,0) not null , "QTY" DOUBLE not null , "TOTAL" DOUBLE not null , "PRICE" DOUBLE not null ,

22

Page 25: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment "SHIP_COMPLETE_DTE" DECIMAL(11,0) not null , "FIRST_SHIP_DTE" DECIMAL(11,0) not null ) IN "USERSPACE1" ; ALTER TABLE CLBROU.SPSALALL ADD CONSTRAINT SDCUST_KEY FOREIGN KEY (CUST_ID) REFERENCES CLBROU.SDCUST (CUST_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT ENFORCED ENABLE QUERY OPTIMIZATION ; ALTER TABLE CLBROU.SPSALALL ADD CONSTRAINT SDPROD_KEY FOREIGN KEY (PROD_ID) REFERENCES CLBROU.SDPROD (PROD_SKU_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT ENFORCED ENABLE QUERY OPTIMIZATION ; ALTER TABLE CLBROU.SPSALALL ADD CONSTRAINT SDTIME_KEY FOREIGN KEY (DATE_ID) REFERENCES CLBROU.SDTIME (DAY_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT ENFORCED ENABLE QUERY OPTIMIZATION ; ALTER TABLE CLBROU.SPSALALL ADD CONSTRAINT SDPROMO_KEY FOREIGN KEY (PROMO_ID) REFERENCES CLBROU.SDPROMO (PROMO_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT ENFORCED ENABLE QUERY OPTIMIZATION ; ALTER TABLE CLBROU.SPSALALL ADD CONSTRAINT SDPTERM_KEY FOREIGN KEY (TERMS_ID) REFERENCES CLBROU.SDTERMS (TERM_ID) ON DELETE NO ACTION ON UPDATE NO ACTION NOT ENFORCED ENABLE QUERY OPTIMIZATION ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU"."AGGR1" ------------------------------------------------ CREATE TABLE "CLBROU"."AGGR1" ( "YEAR" VARCHAR(4) not null , "QUARTER" VARCHAR(8) not null , "MONTH" VARCHAR(8) not null , "DAY" VARCHAR(11) not null , "SEX" VARCHAR(1) not null , "EDUCATION" VARCHAR(16) not null , "MVHHCODE" VARCHAR(2) not null , "FULLNAME" VARCHAR(52) not null , "N_KIDS" VARCHAR(3) not null , "MARRIED" VARCHAR(1) not null , "_TYPE_" DOUBLE not null , "_FREQ_" DOUBLE not null , "QTY" DOUBLE not null ,

23

Page 26: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment "TOTAL" DOUBLE not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU"."AGGR2" ------------------------------------------------ CREATE TABLE "CLBROU"."AGGR2" ( "YEAR" VARCHAR(4) not null , "QUARTER" VARCHAR(8) not null , "MONTH" VARCHAR(8) not null , "DAY" VARCHAR(11) not null , "SEX" VARCHAR(1) not null , "EDUCATION" VARCHAR(16) not null , "MVHHCODE" VARCHAR(2) not null , "FAMILY" VARCHAR(25) not null , "CATEGORY" VARCHAR(25) not null , "SUBCATEGORY" VARCHAR(25) not null , "BRAND" VARCHAR(50) not null , "SKU" VARCHAR(64) not null , "FULLNAME" VARCHAR(52) not null , "N_KIDS" VARCHAR(3) not null , "MARRIED" VARCHAR(1) not null , "_TYPE_" DOUBLE not null , "_FREQ_" DOUBLE not null , "QTY" DOUBLE not null , "TOTAL" DOUBLE not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU"."AGGR3" ------------------------------------------------ CREATE TABLE "CLBROU"."AGGR3" ( "REGION" VARCHAR(25) not null , "STATE" VARCHAR(2) not null , "SEX" VARCHAR(1) not null , "EDUCATION" VARCHAR(16) not null , "MVHHCODE" VARCHAR(2) not null , "CITY" VARCHAR(50) not null , "CUSTIDENTITY" VARCHAR(12) not null , "MEDIA" VARCHAR(50) not null , "PROMO" VARCHAR(50) not null , "TERM" VARCHAR(25) not null , "FULLNAME" VARCHAR(52) not null , "N_KIDS" VARCHAR(3) not null , "MARRIED" VARCHAR(1) not null , "_TYPE_" DOUBLE not null , "_FREQ_" DOUBLE not null , "QTY" DOUBLE not null , "TOTAL" DOUBLE not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU"."AGGR4" ------------------------------------------------ CREATE TABLE "CLBROU"."AGGR4" ( "YEAR" VARCHAR(4) not null , "QUARTER" VARCHAR(8) not null ,

24

Page 27: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment "MONTH" VARCHAR(8) not null , "DAY" VARCHAR(11) not null , "SEX" VARCHAR(1) not null , "EDUCATION" VARCHAR(16) not null , "MVHHCODE" VARCHAR(2) not null , "REGION" VARCHAR(25) not null , "STATE" VARCHAR(2) not null , "CITY" VARCHAR(50) not null , "CUSTIDENTITY" VARCHAR(12) not null , "MEDIA" VARCHAR(50) not null , "PROMO" VARCHAR(50) not null , "TERM" VARCHAR(25) not null , "FULLNAME" VARCHAR(52) not null , "N_KIDS" VARCHAR(3) not null , "MARRIED" VARCHAR(1) not null , "_TYPE_" DOUBLE not null , "_FREQ_" DOUBLE not null , "QTY" DOUBLE not null , "TOTAL" DOUBLE not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU"."AGGR5" ------------------------------------------------ CREATE TABLE "CLBROU"."AGGR5" ( "SEX" VARCHAR(1) not null , "EDUCATION" VARCHAR(16) not null , "MVHHCODE" VARCHAR(2) not null , "REGION" VARCHAR(25) not null , "STATE" VARCHAR(2) not null , "CITY" VARCHAR(50) not null , "CUSTIDENTITY" VARCHAR(12) not null , "MEDIA" VARCHAR(50) not null , "PROMO" VARCHAR(50) not null , "TERM" VARCHAR(25) not null , "FAMILY" VARCHAR(25) not null , "CATEGORY" VARCHAR(25) not null , "SUBCATEGORY" VARCHAR(25) not null , "BRAND" VARCHAR(50) not null , "SKU" VARCHAR(64) not null , "FULLNAME" VARCHAR(52) not null , "N_KIDS" VARCHAR(3) not null , "MARRIED" VARCHAR(1) not null , "_TYPE_" DOUBLE not null , "_FREQ_" DOUBLE not null , "QTY" DOUBLE not null , "TOTAL" DOUBLE not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU"."CD3L4MEDBIGAGGR1" ------------------------------------------------ CREATE TABLE "CLBROU"."CD3L4MEDBIGAGGR1" ( "D1L1" VARCHAR(5) not null , "D1L2" VARCHAR(5) not null , "D1L3" VARCHAR(5) not null , "D1L4" VARCHAR(5) not null , "D2L1" VARCHAR(5) not null , "D2L2" VARCHAR(5) not null ,

25

Page 28: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment "D2L3" VARCHAR(5) not null , "D2L4" VARCHAR(5) not null , "_TYPE_" DOUBLE not null , "_FREQ_" DOUBLE not null , "M1" DOUBLE not null , "M2" DOUBLE not null , "N1" DOUBLE not null , "N2" DOUBLE not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU"."CD3L4MEDBIGAGGR2" ------------------------------------------------ CREATE TABLE "CLBROU"."CD3L4MEDBIGAGGR2" ( "D1L1" VARCHAR(5) not null , "D1L2" VARCHAR(5) not null , "D1L3" VARCHAR(5) not null , "D1L4" VARCHAR(5) not null , "D3L1" VARCHAR(5) not null , "D3L2" VARCHAR(5) not null , "_TYPE_" DOUBLE not null , "_FREQ_" DOUBLE not null , "M1" DOUBLE not null , "M2" DOUBLE not null , "N1" DOUBLE not null , "N2" DOUBLE not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU"."CD3L4MEDBIGAGGR3" ------------------------------------------------ CREATE TABLE "CLBROU"."CD3L4MEDBIGAGGR3" ( "D2L1" VARCHAR(5) not null , "D2L2" VARCHAR(5) not null , "D2L3" VARCHAR(5) not null , "D2L4" VARCHAR(5) not null , "D3L1" VARCHAR(5) not null , "D3L2" VARCHAR(5) not null , "_TYPE_" DOUBLE not null , "_FREQ_" DOUBLE not null , "M1" DOUBLE not null , "M2" DOUBLE not null , "N1" DOUBLE not null , "N2" DOUBLE not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU "."CD3L4MEDBIG" ------------------------------------------------ CREATE TABLE "CLBROU "."CD3L4MEDBIG" ( "D1L1" VARCHAR(5) not null , "D1L2" VARCHAR(5) not null , "D1L3" VARCHAR(5) not null , "D1L4" VARCHAR(5) not null , "D2L1" VARCHAR(5) not null , "D2L2" VARCHAR(5) not null , "D2L3" VARCHAR(5) not null , "D2L4" VARCHAR(5) not null ,

26

Page 29: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment "D3L1" VARCHAR(5) not null , "D3L2" VARCHAR(5) not null , "MEMBER" DOUBLE not null , "M1" DOUBLE not null , "M2" DOUBLE not null , "N1" DOUBLE not null , "N2" DOUBLE not null ) IN "USERSPACE1" ; ------------------------------------------------ -- DDL STATEMENTS FOR TABLE "CLBROU "."CD3L4MEDBIG_MQT" ------------------------------------------------ SET CURRENT SCHEMA = "CLBROU "; SET CURRENT PATH = "SYSIBM","SYSFUN","SYSPROC","CLBROU"; CREATE TABLE CD3L4MEDBIG_MQT AS

(SELECT CD3L4MEDBIG.D1L1, CD3L4MEDBIG.D1L2, CD3L4MEDBIG.D1L3, CD3L4MEDBIG.D1L4, CD3L4MEDBIG.D2L1, CD3L4MEDBIG.D2L2, CD3L4MEDBIG.D2L3, CD3L4MEDBIG.D2L4, SUM(CD3L4MEDBIG.N1) AS SUM_N1, SUM(CD3L4MEDBIG.M1) AS SUM_M1

FROM CD3L4MEDBIG WHERE (CD3L4MEDBIG.D1L1 = ' 1') AND (CD3L4MEDBIG.D1L2 = ' 1') AND ( CD3L4MEDBIG.D1L3 IN (' 1', ' 2', ' 3', ' 4')) AND (CD3L4MEDBIG.D2L1 = ' 1') AND (CD3L4MEDBIG.D2L2 = ' 1') AND ( CD3L4MEDBIG.D2L3 IN (' 1', ' 2', ' 3', ' 4') ) AND (CD3L4MEDBIG.D3L1 = ' 1') AND (CD3L4MEDBIG.D3L2 = '1') GROUP BY CD3L4MEDBIG.D1L1, CD3L4MEDBIG.D1L2, CD3L4MEDBIG.D1L3, CD3L4MEDBIG.D1L4, CD3L4MEDBIG.D2L1, CD3L4MEDBIG.D2L2, CD3L4MEDBIG.D2L3, CD3L4MEDBIG.D2L4) DATA INITIALLY DEFERRED REFRESH DEFERRED ENABLE QUERY OPTIMIZATION NOT LOGGED INITIALLY;

COMMIT WORK; CONNECT RESET; TERMINATE;

27

Page 30: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Appendix B: OLAP Cube Models Two slightly different cube models were used in testing. The first is the Baseline Cube, which includes only the basic cube model and the cube that’s needed to execute. No aggregations or MQTs were identified to the SAS OLAP Server.

The second cube model includes several changes at the bottom of the file that add a single aggregation to the cube and identify it to SAS OLAP Server. Because most of the second file is the same as the first file, only the bottom section of the second file is included. To use, cut-and-paste it into the Baseline Cube file (replacing the corresponding section at the bottom of that file).

Baseline Cube File The following program can be used to import the Baseline DB2Sales Cube into SAS OLAP Studio to generate the OLAP Cube.

LIBNAME DB2 PRESERVE_COL_NAMES=YES PRESERVE_TAB_NAMES=YES DATASRC=CV SCHEMA=CLBROU USER=sasadm PASSWORD=xxxxxxxx; /*------------------------------------------------------*/ /* DB2 SALES cube */ /*------------------------------------------------------*/ proc olap cube=db2sales delete; metasvr host=D10713 port=8561 protocol=bridge userid=sasadm pw="xxxxxxxx" repository=foundation olap_schema="SASMain - OLAP Schema"; run; PROC OLAP DATA=DB2.SPSALALL CUBE=DB2Sales PATH="C:\OLAPSrv" NO_NWAY; metasvr host=D10713 port=8561 protocol=bridge userid=sasadm pw="xxxxxxxxx" repository=foundation olap_schema="SASMain - OLAP Schema"; DIMENSION CustEducation HIERARCHIES=(CustEducation) DIMTABLE= DB2.SDCUST DIMKEY=cust_id FACTKEY=cust_id CAPTION="Cust Education"; HIERARCHY CustEducation LEVELS=(education) DESC="Cust Education"; LEVEL education SORT_ORDER=ASCFORMATTED; DIMENSION CustMVHH HIERARCHIES=(CustMVHH) DIMTABLE= DB2.SDCUST DIMKEY=cust_id FACTKEY=cust_id CAPTION="Cust MVHH"; HIERARCHY CustMVHH LEVELS=(mvhhCode) DESC="Cust MVHH"; LEVEL mvhhCode SORT_ORDER=ASCENDING; DIMENSION CustSex HIERARCHIES=(CustSex) DIMTABLE=DB2.SDCUST

28

Page 31: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment DIMKEY=cust_id FACTKEY=cust_id CAPTION="Cust Sex"; HIERARCHY CustSex LEVELS=(sex) DESC="Cust Sex"; LEVEL sex SORT_ORDER=ASCFORMATTED; DIMENSION Customer HIERARCHIES=(customer) DIMTABLE=DB2.SDCUST DIMKEY=cust_id FACTKEY=cust_id CAPTION="Customer"; HIERARCHY customer LEVELS=(region state city custIdentity) DESC="Customer"; LEVEL region SORT_ORDER=ASCFORMATTED; LEVEL state SORT_ORDER=ASCFORMATTED; LEVEL city SORT_ORDER=ASCFORMATTED; PROPERTY cust_name COLUMN=fullname LEVEL=custIdentity; PROPERTY sex LEVEL=custIdentity; PROPERTY education LEVEL=custIdentity; PROPERTY mvhhcode LEVEL=custIdentity; PROPERTY n_kids LEVEL=custIdentity; PROPERTY married LEVEL=custIdentity; DIMENSION Promotion HIERARCHIES=(promotion) DIMTABLE=DB2.SDPROMO DIMKEY=promo_id FACTKEY=promo_id CAPTION="Promotion"; HIERARCHY promotion LEVELS=(media promo) DESC="Promotion"; LEVEL media SORT_ORDER=ASCENDING; LEVEL promo SORT_ORDER=ASCENDING; DIMENSION Terms HIERARCHIES=(terms) DIMTABLE=DB2.SDTERMS DIMKEY=term_id FACTKEY=terms_id CAPTION="Terms"; HIERARCHY terms LEVELS=(term) DESC="Terms"; LEVEL term SORT_ORDER=ASCENDING; DIMENSION Product HIERARCHIES=(product) DIMTABLE=DB2.SDPROD DIMKEY=prod_sku_id FACTKEY=prod_id CAPTION="Product"; HIERARCHY product LEVELS=(family category subcategory brand sku) DESC="Produt"; LEVEL family SORT_ORDER=ASCENDING; LEVEL category SORT_ORDER=ASCENDING; LEVEL subcategory SORT_ORDER=ASCENDING; LEVEL brand SORT_ORDER=ASCENDING;

29

Page 32: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment LEVEL sku SORT_ORDER=ASCENDING; DIMENSION Time HIERARCHIES=(time) TYPE=time DIMTABLE=DB2.SDTIME DIMKEY=day_id FACTKEY=date_id CAPTION="Time"; HIERARCHY time LEVELS=(year quarter month day) DESC="Time"; LEVEL year type=year ; LEVEL quarter type=quarters; LEVEL month type=months ; LEVEL day type=days ; /*------------------------------------------------------------------*/ /* Replace the following to add aggregation code */ /*------------------------------------------------------------------*/ measure qty column=qty stat=sum format=comma15.0 ; measure total column=total stat=sum format=comma15.2 ; define Member "[DB2Sales].[Measures].[ASP]" as '[Measures].[total] / [Measures].[QTY]' ; RUN; /*------------------------------------------------------------------*/ /*----------------End of section to change-----------------*/ /*------------------------------------------------------------------*/

Aggregation Cube File As stated earlier, this section contains the changes that are needed in the Baseline Cube file that’s shown above. Replace the bottom section of the Baseline Cube file with this section.

/*------------------------------------------------------------------*/ /* Changes to add a single aggregation for MQT1 */ /*------------------------------------------------------------------*/ measure qty column=qty aggr_column=qty stat=sum format=comma15.0 ; measure total column=total aggr_column=total stat=sum format=comma15.2 ; aggregation year quarter family category sex / table=DB2.MQT1; define Member "[DB2Sales].[Measures].[ASP]" as '[Measures].[total] / [Measures].[QTY]' ; RUN; /*------------------------------------------------------------------*/ /*----------------End of changes ----------------------------*/ /*------------------------------------------------------------------*/

30

Page 33: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Appendix C: DB2 Cube Views Model Export The following is an export of the metadata that was used, as generated by the DB2 Cube Views wizard. It also contains additional data that was manually entered into DB2 Cube Views.

<?xml version="1.0" encoding="UTF-8"?> <olap:metadata xmlns:olap="http://www.ibm.com/olap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="8.2.0.1.0"> <attribute name="CITY (SDCUST)" schema="CLBROU" businessName="CITY" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="50" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="CITY" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="CITY_ID (SDCUST)" schema="CLBROU" businessName="CITY_ID" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="CITY_ID" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="CITY_NAME (SDCUST)" schema="CLBROU" businessName="CITY_NAME" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="50" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="CITY_NAME" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="CUST_FNAME (SDCUST)" schema="CLBROU" businessName="CUST_FNAME" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="25" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="CUST_FNAME" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="CUST_ID (SDCUST)" schema="CLBROU" businessName="CUST_ID" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="CUST_ID" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="CUST_IDENTITY_CODE (SDCUST)" schema="CLBROU" businessName="CUST_IDENTITY_CODE" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="12" scale="0" nullable="no"/> <sqlExpression template="{$$1}">

31

Page 34: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <column name="CUST_IDENTITY_CODE" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="CUST_LNAME (SDCUST)" schema="CLBROU" businessName="CUST_LNAME" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="25" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="CUST_LNAME" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="CUSTIDENTITY (SDCUST)" schema="CLBROU" businessName="CUSTIDENTITY" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="12" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="CUSTIDENTITY" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="EDUCATION (SDCUST)" schema="CLBROU" businessName="EDUCATION" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="16" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="EDUCATION" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="FULL_CITY (SDCUST)" schema="CLBROU" businessName="FULL_CITY" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="54" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="FULL_CITY" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="FULLNAME (SDCUST)" schema="CLBROU" businessName="FULLNAME" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="52" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="FULLNAME" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="LOCALE_ID (SDCUST)" schema="CLBROU" businessName="LOCALE_ID" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="LOCALE_ID" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="MARRIED (SDCUST)" schema="CLBROU" businessName="MARRIED" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="1" scale="0" nullable="no"/> <sqlExpression template="{$$1}">

32

Page 35: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <column name="MARRIED" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="MVHHCODE (SDCUST)" schema="CLBROU" businessName="MVHHCODE" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="2" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="MVHHCODE" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="N_KIDS (SDCUST)" schema="CLBROU" businessName="N_KIDS" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="3" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="N_KIDS" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="NUM_MVHHCODE (SDCUST)" schema="CLBROU" businessName="NUM_MVHHCODE" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="NUM_MVHHCODE" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="REGION (SDCUST)" schema="CLBROU" businessName="REGION" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="25" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="REGION" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="REGION_ID (SDCUST)" schema="CLBROU" businessName="REGION_ID" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="4" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="REGION_ID" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="REGION_NAME (SDCUST)" schema="CLBROU" businessName="REGION_NAME" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="25" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="REGION_NAME" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="SEX (SDCUST)" schema="CLBROU" businessName="SEX" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="1" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="SEX" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute>

33

Page 36: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <attribute name="STATE (SDCUST)" schema="CLBROU" businessName="STATE" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="2" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="STATE" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="STATE_NAME (SDCUST)" schema="CLBROU" businessName="STATE_NAME" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="2" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="STATE_NAME" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="ZIPCODE (SDCUST)" schema="CLBROU" businessName="ZIPCODE" createTime="2004-12-22T21:33:23" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="5" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="ZIPCODE" tableSchema="CLBROU" tableName="SDCUST"/> </sqlExpression> </attribute> <attribute name="CUST_ID (SPSALALL)" schema="CLBROU" businessName="CUST_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="CUST_ID" tableSchema="CLBROU" tableName="SPSALALL"/> </sqlExpression> </attribute> <attribute name="BRAND (SDPROD)" schema="CLBROU" businessName="BRAND" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="50" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="BRAND" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="BRAND_NAME (SDPROD)" schema="CLBROU" businessName="BRAND_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="50" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="BRAND_NAME" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="CATEGORY (SDPROD)" schema="CLBROU" businessName="CATEGORY" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="25" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="CATEGORY" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="CATEGORY_NAME (SDPROD)" schema="CLBROU" businessName="CATEGORY_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU">

34

Page 37: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <datatype schema="SYSIBM" name="VARCHAR" length="25" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="CATEGORY_NAME" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="FAMILY (SDPROD)" schema="CLBROU" businessName="FAMILY" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="25" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="FAMILY" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="FAMILY_NAME (SDPROD)" schema="CLBROU" businessName="FAMILY_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="25" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="FAMILY_NAME" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="MANUF_ID (SDPROD)" schema="CLBROU" businessName="MANUF_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="MANUF_ID" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="MANUF_NAME (SDPROD)" schema="CLBROU" businessName="MANUF_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="32" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="MANUF_NAME" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="PROD_BRAND_ID (SDPROD)" schema="CLBROU" businessName="PROD_BRAND_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROD_BRAND_ID" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="PROD_CATEGORY_ID (SDPROD)" schema="CLBROU" businessName="PROD_CATEGORY_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROD_CATEGORY_ID" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="PROD_FAMILY_ID (SDPROD)" schema="CLBROU" businessName="PROD_FAMILY_ID" createTime="2004-12-22T21:33:24" creator="CLBROU">

35

Page 38: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROD_FAMILY_ID" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="PROD_MANUF_BRAND_ID (SDPROD)" schema="CLBROU" businessName="PROD_MANUF_BRAND_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROD_MANUF_BRAND_ID" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="PROD_SKU_ALT_NAME (SDPROD)" schema="CLBROU" businessName="PROD_SKU_ALT_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="64" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROD_SKU_ALT_NAME" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="PROD_SKU_ID (SDPROD)" schema="CLBROU" businessName="PROD_SKU_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROD_SKU_ID" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="PROD_SKU_NAME (SDPROD)" schema="CLBROU" businessName="PROD_SKU_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="50" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROD_SKU_NAME" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="PROD_SUBCATEGORY_ID (SDPROD)" schema="CLBROU" businessName="PROD_SUBCATEGORY_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROD_SUBCATEGORY_ID" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="SHIPWEIGHT (SDPROD)" schema="CLBROU" businessName="SHIPWEIGHT" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DOUBLE" length="8" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="SHIPWEIGHT" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute>

36

Page 39: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <attribute name="SKU (SDPROD)" schema="CLBROU" businessName="SKU" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="64" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="SKU" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="SUBCATEGORY (SDPROD)" schema="CLBROU" businessName="SUBCATEGORY" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="25" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="SUBCATEGORY" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="SUBCATEGORY_NAME (SDPROD)" schema="CLBROU" businessName="SUBCATEGORY_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="25" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="SUBCATEGORY_NAME" tableSchema="CLBROU" tableName="SDPROD"/> </sqlExpression> </attribute> <attribute name="PROD_ID (SPSALALL)" schema="CLBROU" businessName="PROD_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROD_ID" tableSchema="CLBROU" tableName="SPSALALL"/> </sqlExpression> </attribute> <attribute name="MEDIA (SDPROMO)" schema="CLBROU" businessName="MEDIA" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="50" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="MEDIA" tableSchema="CLBROU" tableName="SDPROMO"/> </sqlExpression> </attribute> <attribute name="MEDIA_ID (SDPROMO)" schema="CLBROU" businessName="MEDIA_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="INTEGER" length="4" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="MEDIA_ID" tableSchema="CLBROU" tableName="SDPROMO"/> </sqlExpression> </attribute> <attribute name="MEDIA_NAME (SDPROMO)" schema="CLBROU" businessName="MEDIA_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="50" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="MEDIA_NAME" tableSchema="CLBROU" tableName="SDPROMO"/> </sqlExpression> </attribute> <attribute name="PROMO (SDPROMO)" schema="CLBROU" businessName="PROMO" createTime="2004-12-22T21:33:24" creator="CLBROU">

37

Page 40: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <datatype schema="SYSIBM" name="VARCHAR" length="50" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROMO" tableSchema="CLBROU" tableName="SDPROMO"/> </sqlExpression> </attribute> <attribute name="PROMO_ID (SDPROMO)" schema="CLBROU" businessName="PROMO_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="INTEGER" length="4" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROMO_ID" tableSchema="CLBROU" tableName="SDPROMO"/> </sqlExpression> </attribute> <attribute name="PROMO_NAME (SDPROMO)" schema="CLBROU" businessName="PROMO_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="50" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROMO_NAME" tableSchema="CLBROU" tableName="SDPROMO"/> </sqlExpression> </attribute> <attribute name="PROMO_ID (SPSALALL)" schema="CLBROU" businessName="PROMO_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="PROMO_ID" tableSchema="CLBROU" tableName="SPSALALL"/> </sqlExpression> </attribute> <attribute name="TERM (SDTERMS)" schema="CLBROU" businessName="TERM" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="8" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="TERM" tableSchema="CLBROU" tableName="SDTERMS"/> </sqlExpression> </attribute> <attribute name="TERM_DESC (SDTERMS)" schema="CLBROU" businessName="TERM_DESC" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="25" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="TERM_DESC" tableSchema="CLBROU" tableName="SDTERMS"/> </sqlExpression> </attribute> <attribute name="TERM_ID (SDTERMS)" schema="CLBROU" businessName="TERM_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="TERM_ID" tableSchema="CLBROU" tableName="SDTERMS"/> </sqlExpression> </attribute> <attribute name="TERMS_ID (SPSALALL)" schema="CLBROU" businessName="TERMS_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/>

38

Page 41: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <sqlExpression template="{$$1}"> <column name="TERMS_ID" tableSchema="CLBROU" tableName="SPSALALL"/> </sqlExpression> </attribute> <attribute name="DAY (SDTIME)" schema="CLBROU" businessName="DAY" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="DAY" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="DAY_DATE (SDTIME)" schema="CLBROU" businessName="DAY_DATE" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DATE" length="10" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="DAY_DATE" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="DAY_ID (SDTIME)" schema="CLBROU" businessName="DAY_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="DAY_ID" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="DAY_NAME (SDTIME)" schema="CLBROU" businessName="DAY_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="12" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="DAY_NAME" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="DAYOFWEEK_ID (SDTIME)" schema="CLBROU" businessName="DAYOFWEEK_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="DAYOFWEEK_ID" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="DAYOFWEEK_NAME (SDTIME)" schema="CLBROU" businessName="DAYOFWEEK_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="12" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="DAYOFWEEK_NAME" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="MONTH (SDTIME)" schema="CLBROU" businessName="MONTH" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="8" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="MONTH" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression>

39

Page 42: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment </attribute> <attribute name="MONTH_ID (SDTIME)" schema="CLBROU" businessName="MONTH_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="MONTH_ID" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="MONTH_NAME (SDTIME)" schema="CLBROU" businessName="MONTH_NAME" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="12" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="MONTH_NAME" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="MONTH_OF_YEAR_ID (SDTIME)" schema="CLBROU" businessName="MONTH_OF_YEAR_ID" createTime="2004-12-22T21:33:24" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="MONTH_OF_YEAR_ID" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="QUARTER (SDTIME)" schema="CLBROU" businessName="QUARTER" createTime="2004-12-22T21:33:25" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="8" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="QUARTER" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="QUARTER_ID (SDTIME)" schema="CLBROU" businessName="QUARTER_ID" createTime="2004-12-22T21:33:25" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="QUARTER_ID" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="QUARTER_NAME (SDTIME)" schema="CLBROU" businessName="QUARTER_NAME" createTime="2004-12-22T21:33:25" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="12" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="QUARTER_NAME" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="WEEK_DESC (SDTIME)" schema="CLBROU" businessName="WEEK_DESC" createTime="2004-12-22T21:33:25" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="12" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="WEEK_DESC" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute>

40

Page 43: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <attribute name="WEEK_ID (SDTIME)" schema="CLBROU" businessName="WEEK_ID" createTime="2004-12-22T21:33:25" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="WEEK_ID" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="WEEK_OF_YEAR_ID (SDTIME)" schema="CLBROU" businessName="WEEK_OF_YEAR_ID" createTime="2004-12-22T21:33:25" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="WEEK_OF_YEAR_ID" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="YEAR (SDTIME)" schema="CLBROU" businessName="YEAR" createTime="2004-12-22T21:33:25" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="4" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="YEAR" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="YEAR_ID (SDTIME)" schema="CLBROU" businessName="YEAR_ID" createTime="2004-12-22T21:33:25" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="YEAR_ID" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="YEAR_NAME (SDTIME)" schema="CLBROU" businessName="YEAR_NAME" createTime="2004-12-22T21:33:25" creator="CLBROU"> <datatype schema="SYSIBM" name="VARCHAR" length="12" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="YEAR_NAME" tableSchema="CLBROU" tableName="SDTIME"/> </sqlExpression> </attribute> <attribute name="DATE_ID (SPSALALL)" schema="CLBROU" businessName="DATE_ID" createTime="2004-12-22T21:33:25" creator="CLBROU"> <datatype schema="SYSIBM" name="DECIMAL" length="11" scale="0" nullable="no"/> <sqlExpression template="{$$1}"> <column name="DATE_ID" tableSchema="CLBROU" tableName="SPSALALL"/> </sqlExpression> </attribute> <join name="SPSALALL-SDCUST" schema="CLBROU" businessName="SPSALALL-SDCUST" createTime="2004-12-22T21:33:25" creator="CLBROU" type="inner" cardinality="n:1"> <attributeJoin operator="="> <leftAttributeRef name="CUST_ID (SPSALALL)" schema="CLBROU"/> <rightAttributeRef name="CUST_ID (SDCUST)" schema="CLBROU"/> </attributeJoin> </join> <join name="SPSALALL-SDPROD" schema="CLBROU" businessName="SPSALALL-SDPROD" createTime="2004-12-22T21:33:25" creator="CLBROU" type="inner" cardinality="n:1"> <attributeJoin operator="="> <leftAttributeRef name="PROD_ID (SPSALALL)" schema="CLBROU"/>

41

Page 44: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <rightAttributeRef name="PROD_SKU_ID (SDPROD)" schema="CLBROU"/> </attributeJoin> </join> <join name="SPSALALL-SDPROMO" schema="CLBROU" businessName="SPSALALL-SDPROMO" createTime="2004-12-22T21:33:25" creator="CLBROU" type="inner" cardinality="n:1"> <attributeJoin operator="="> <leftAttributeRef name="PROMO_ID (SPSALALL)" schema="CLBROU"/> <rightAttributeRef name="PROMO_ID (SDPROMO)" schema="CLBROU"/> </attributeJoin> </join> <join name="SPSALALL-SDTERMS" schema="CLBROU" businessName="SPSALALL-SDTERMS" createTime="2004-12-22T21:33:25" creator="CLBROU" type="inner" cardinality="n:1"> <attributeJoin operator="="> <leftAttributeRef name="TERMS_ID (SPSALALL)" schema="CLBROU"/> <rightAttributeRef name="TERM_ID (SDTERMS)" schema="CLBROU"/> </attributeJoin> </join> <join name="SPSALALL-SDTIME" schema="CLBROU" businessName="SPSALALL-SDTIME" createTime="2004-12-22T21:33:25" creator="CLBROU" type="inner" cardinality="n:1"> <attributeJoin operator="="> <leftAttributeRef name="DATE_ID (SPSALALL)" schema="CLBROU"/> <rightAttributeRef name="DAY_ID (SDTIME)" schema="CLBROU"/> </attributeJoin> </join> <level name="education" schema="CLBROU" businessName="education" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="EDUCATION (SDCUST)" schema="CLBROU"/> <defaultAttributeRef name="EDUCATION (SDCUST)" schema="CLBROU"/> </level> <level name="mvhhcode" schema="CLBROU" businessName="mvhhcode" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="MVHHCODE (SDCUST)" schema="CLBROU"/> <defaultAttributeRef name="MVHHCODE (SDCUST)" schema="CLBROU"/> </level> <level name="sex" schema="CLBROU" businessName="sex" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="SEX (SDCUST)" schema="CLBROU"/> <defaultAttributeRef name="SEX (SDCUST)" schema="CLBROU"/> </level> <level name="region" schema="CLBROU" businessName="region" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="REGION (SDCUST)" schema="CLBROU"/> <defaultAttributeRef name="REGION (SDCUST)" schema="CLBROU"/> </level> <level name="state" schema="CLBROU" businessName="state" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="STATE (SDCUST)" schema="CLBROU"/> <defaultAttributeRef name="STATE (SDCUST)" schema="CLBROU"/> </level> <level name="city" schema="CLBROU" businessName="city" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="CITY (SDCUST)" schema="CLBROU"/> <defaultAttributeRef name="CITY (SDCUST)" schema="CLBROU"/> </level>

42

Page 45: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <level name="custIdentity" schema="CLBROU" businessName="custIdentity" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="FULLNAME (SDCUST)" schema="CLBROU"/> <defaultAttributeRef name="FULLNAME (SDCUST)" schema="CLBROU"/> <relatedAttributeRef name="CUST_ID (SDCUST)" schema="CLBROU"/> <relatedAttributeRef name="EDUCATION (SDCUST)" schema="CLBROU"/> <relatedAttributeRef name="MARRIED (SDCUST)" schema="CLBROU"/> <relatedAttributeRef name="MVHHCODE (SDCUST)" schema="CLBROU"/> <relatedAttributeRef name="N_KIDS (SDCUST)" schema="CLBROU"/> <relatedAttributeRef name="SEX (SDCUST)" schema="CLBROU"/> </level> <level name="media" schema="CLBROU" businessName="media" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="MEDIA (SDPROMO)" schema="CLBROU"/> <defaultAttributeRef name="MEDIA (SDPROMO)" schema="CLBROU"/> </level> <level name="promo" schema="CLBROU" businessName="promo" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="PROMO (SDPROMO)" schema="CLBROU"/> <defaultAttributeRef name="PROMO (SDPROMO)" schema="CLBROU"/> </level> <level name="term" schema="CLBROU" businessName="term" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="TERM (SDTERMS)" schema="CLBROU"/> <defaultAttributeRef name="TERM (SDTERMS)" schema="CLBROU"/> </level> <level name="family" schema="CLBROU" businessName="family" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="FAMILY (SDPROD)" schema="CLBROU"/> <defaultAttributeRef name="FAMILY (SDPROD)" schema="CLBROU"/> </level> <level name="category" schema="CLBROU" businessName="category" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="CATEGORY (SDPROD)" schema="CLBROU"/> <defaultAttributeRef name="CATEGORY (SDPROD)" schema="CLBROU"/> </level> <level name="subcategory" schema="CLBROU" businessName="subcategory" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="SUBCATEGORY (SDPROD)" schema="CLBROU"/> <defaultAttributeRef name="SUBCATEGORY (SDPROD)" schema="CLBROU"/> </level> <level name="brand" schema="CLBROU" businessName="brand" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="BRAND (SDPROD)" schema="CLBROU"/> <defaultAttributeRef name="BRAND (SDPROD)" schema="CLBROU"/> </level> <level name="sku" schema="CLBROU" businessName="sku" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="SKU (SDPROD)" schema="CLBROU"/> <defaultAttributeRef name="SKU (SDPROD)" schema="CLBROU"/> </level> <level name="year" schema="CLBROU" businessName="year" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="YEAR (SDTIME)" schema="CLBROU"/> <defaultAttributeRef name="YEAR (SDTIME)" schema="CLBROU"/> </level>

43

Page 46: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <level name="quarter" schema="CLBROU" businessName="quarter" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="QUARTER (SDTIME)" schema="CLBROU"/> <defaultAttributeRef name="QUARTER (SDTIME)" schema="CLBROU"/> </level> <level name="month" schema="CLBROU" businessName="month" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="MONTH (SDTIME)" schema="CLBROU"/> <defaultAttributeRef name="MONTH (SDTIME)" schema="CLBROU"/> </level> <level name="day" schema="CLBROU" businessName="day" createTime="2004-12-22T21:33:25" creator="CLBROU" funcDep="no" funcDepName=""> <levelKeyRef name="DAY (SDTIME)" schema="CLBROU"/> <defaultAttributeRef name="DAY (SDTIME)" schema="CLBROU"/> </level> <cubeLevel name="sex (OLMDGB4P)" schema="CLBROU" businessName="sex" createTime="2004-12-22T21:35:31" creator="CLBROU"> <levelRef name="sex" schema="CLBROU"/> </cubeLevel> <cubeLevel name="family (OLMDGB4P)" schema="CLBROU" businessName="family" createTime="2004-12-22T21:35:31" creator="CLBROU"> <levelRef name="family" schema="CLBROU"/> </cubeLevel> <cubeLevel name="category (OLMDGB4P)" schema="CLBROU" businessName="category" createTime="2004-12-22T21:35:31" creator="CLBROU"> <levelRef name="category" schema="CLBROU"/> </cubeLevel> <cubeLevel name="year (OLMDGB4P)" schema="CLBROU" businessName="year" createTime="2004-12-22T21:35:32" creator="CLBROU"> <levelRef name="year" schema="CLBROU"/> </cubeLevel> <cubeLevel name="quarter (OLMDGB4P)" schema="CLBROU" businessName="quarter" createTime="2004-12-22T21:35:32" creator="CLBROU"> <levelRef name="quarter" schema="CLBROU"/> </cubeLevel> <hierarchy name="CustEducation" schema="CLBROU" businessName="CustEducation" createTime="2004-12-22T21:33:25" creator="CLBROU" type="balanced" deployment="standard"> <levelRef name="education" schema="CLBROU"/> </hierarchy> <hierarchy name="CustMVHH" schema="CLBROU" businessName="CustMVHH" createTime="2004-12-22T21:33:25" creator="CLBROU" type="balanced" deployment="standard"> <levelRef name="mvhhcode" schema="CLBROU"/> </hierarchy> <hierarchy name="CustSex" schema="CLBROU" businessName="CustSex" createTime="2004-12-22T21:33:25" creator="CLBROU" type="balanced" deployment="standard"> <levelRef name="sex" schema="CLBROU"/> </hierarchy> <hierarchy name="customer" schema="CLBROU" businessName="customer" createTime="2004-12-22T21:33:25" creator="CLBROU" type="balanced" deployment="standard"> <levelRef name="region" schema="CLBROU"/> <levelRef name="state" schema="CLBROU"/> <levelRef name="city" schema="CLBROU"/> <levelRef name="custIdentity" schema="CLBROU"/> </hierarchy>

44

Page 47: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <hierarchy name="promotion" schema="CLBROU" businessName="promotion" createTime="2004-12-22T21:33:25" creator="CLBROU" type="balanced" deployment="standard"> <levelRef name="media" schema="CLBROU"/> <levelRef name="promo" schema="CLBROU"/> </hierarchy> <hierarchy name="terms" schema="CLBROU" businessName="terms" createTime="2004-12-22T21:33:25" creator="CLBROU" type="balanced" deployment="standard"> <levelRef name="term" schema="CLBROU"/> </hierarchy> <hierarchy name="product" schema="CLBROU" businessName="product" createTime="2004-12-22T21:33:25" creator="CLBROU" type="balanced" deployment="standard"> <levelRef name="family" schema="CLBROU"/> <levelRef name="category" schema="CLBROU"/> <levelRef name="subcategory" schema="CLBROU"/> <levelRef name="brand" schema="CLBROU"/> <levelRef name="sku" schema="CLBROU"/> </hierarchy> <hierarchy name="time" schema="CLBROU" businessName="time" createTime="2004-12-22T21:33:25" creator="CLBROU" type="balanced" deployment="standard"> <levelRef name="year" schema="CLBROU"/> <levelRef name="quarter" schema="CLBROU"/> <levelRef name="month" schema="CLBROU"/> <levelRef name="day" schema="CLBROU"/> </hierarchy> <cubeHierarchy name="CustSex (OLMDGB4P)" schema="CLBROU" businessName="CustSex" createTime="2004-12-22T21:35:31" creator="CLBROU"> <cubeLevelRef name="sex (OLMDGB4P)" schema="CLBROU"/> <hierarchyRef name="CustSex" schema="CLBROU"/> </cubeHierarchy> <cubeHierarchy name="product (OLMDGB4P)" schema="CLBROU" businessName="product" createTime="2004-12-22T21:35:31" creator="CLBROU" modifyTime="2004-12-22T21:45:32" modifier="CLBROU"> <cubeLevelRef name="family (OLMDGB4P)" schema="CLBROU"/> <cubeLevelRef name="category (OLMDGB4P)" schema="CLBROU"/> <hierarchyRef name="product" schema="CLBROU"/> </cubeHierarchy> <cubeHierarchy name="time (OLMDGB4P)" schema="CLBROU" businessName="time" createTime="2004-12-22T21:35:32" creator="CLBROU" modifyTime="2004-12-22T21:43:21" modifier="CLBROU"> <cubeLevelRef name="year (OLMDGB4P)" schema="CLBROU"/> <cubeLevelRef name="quarter (OLMDGB4P)" schema="CLBROU"/> <hierarchyRef name="time" schema="CLBROU"/> </cubeHierarchy> <dimension name="CustEducation" schema="CLBROU" businessName="CustEducation" createTime="2004-12-22T21:33:25" creator="CLBROU" type="regular"> <attributeRef name="CUST_ID (SDCUST)" schema="CLBROU"/> <attributeRef name="EDUCATION (SDCUST)" schema="CLBROU"/> <hierarchyRef name="CustEducation" schema="CLBROU"/> <levelRef name="education" schema="CLBROU"/> </dimension> <dimension name="CustMVHH" schema="CLBROU" businessName="CustMVHH" createTime="2004-12-22T21:33:25" creator="CLBROU" type="regular"> <attributeRef name="CUST_ID (SDCUST)" schema="CLBROU"/> <attributeRef name="MVHHCODE (SDCUST)" schema="CLBROU"/> <hierarchyRef name="CustMVHH" schema="CLBROU"/> <levelRef name="mvhhcode" schema="CLBROU"/> </dimension>

45

Page 48: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <dimension name="CustSex" schema="CLBROU" businessName="CustSex" createTime="2004-12-22T21:33:25" creator="CLBROU" type="regular"> <attributeRef name="CUST_ID (SDCUST)" schema="CLBROU"/> <attributeRef name="SEX (SDCUST)" schema="CLBROU"/> <hierarchyRef name="CustSex" schema="CLBROU"/> <levelRef name="sex" schema="CLBROU"/> </dimension> <dimension name="Customer" schema="CLBROU" businessName="Customer" createTime="2004-12-22T21:33:26" creator="CLBROU" type="regular"> <attributeRef name="CITY (SDCUST)" schema="CLBROU"/> <attributeRef name="CUST_ID (SDCUST)" schema="CLBROU"/> <attributeRef name="EDUCATION (SDCUST)" schema="CLBROU"/> <attributeRef name="FULLNAME (SDCUST)" schema="CLBROU"/> <attributeRef name="MARRIED (SDCUST)" schema="CLBROU"/> <attributeRef name="MVHHCODE (SDCUST)" schema="CLBROU"/> <attributeRef name="N_KIDS (SDCUST)" schema="CLBROU"/> <attributeRef name="REGION (SDCUST)" schema="CLBROU"/> <attributeRef name="SEX (SDCUST)" schema="CLBROU"/> <attributeRef name="STATE (SDCUST)" schema="CLBROU"/> <hierarchyRef name="customer" schema="CLBROU"/> <levelRef name="city" schema="CLBROU"/> <levelRef name="custIdentity" schema="CLBROU"/> <levelRef name="region" schema="CLBROU"/> <levelRef name="state" schema="CLBROU"/> </dimension> <dimension name="Promotion" schema="CLBROU" businessName="Promotion" createTime="2004-12-22T21:33:26" creator="CLBROU" type="regular"> <attributeRef name="MEDIA (SDPROMO)" schema="CLBROU"/> <attributeRef name="PROMO (SDPROMO)" schema="CLBROU"/> <attributeRef name="PROMO_ID (SDPROMO)" schema="CLBROU"/> <hierarchyRef name="promotion" schema="CLBROU"/> <levelRef name="media" schema="CLBROU"/> <levelRef name="promo" schema="CLBROU"/> </dimension> <dimension name="Terms" schema="CLBROU" businessName="Terms" createTime="2004-12-22T21:33:26" creator="CLBROU" type="regular"> <attributeRef name="TERM (SDTERMS)" schema="CLBROU"/> <attributeRef name="TERM_ID (SDTERMS)" schema="CLBROU"/> <hierarchyRef name="terms" schema="CLBROU"/> <levelRef name="term" schema="CLBROU"/> </dimension> <dimension name="Product" schema="CLBROU" businessName="Product" createTime="2004-12-22T21:33:26" creator="CLBROU" type="regular"> <attributeRef name="BRAND (SDPROD)" schema="CLBROU"/> <attributeRef name="CATEGORY (SDPROD)" schema="CLBROU"/> <attributeRef name="FAMILY (SDPROD)" schema="CLBROU"/> <attributeRef name="PROD_SKU_ID (SDPROD)" schema="CLBROU"/> <attributeRef name="SKU (SDPROD)" schema="CLBROU"/> <attributeRef name="SUBCATEGORY (SDPROD)" schema="CLBROU"/> <hierarchyRef name="product" schema="CLBROU"/> <levelRef name="brand" schema="CLBROU"/> <levelRef name="category" schema="CLBROU"/> <levelRef name="family" schema="CLBROU"/> <levelRef name="sku" schema="CLBROU"/> <levelRef name="subcategory" schema="CLBROU"/> </dimension> <dimension name="Time" schema="CLBROU" businessName="Time" createTime="2004-12-22T21:33:26" creator="CLBROU" type="time"> <attributeRef name="DAY (SDTIME)" schema="CLBROU"/> <attributeRef name="DAY_ID (SDTIME)" schema="CLBROU"/> <attributeRef name="MONTH (SDTIME)" schema="CLBROU"/> <attributeRef name="QUARTER (SDTIME)" schema="CLBROU"/> <attributeRef name="YEAR (SDTIME)" schema="CLBROU"/>

46

Page 49: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <hierarchyRef name="time" schema="CLBROU"/> <levelRef name="day" schema="CLBROU"/> <levelRef name="month" schema="CLBROU"/> <levelRef name="quarter" schema="CLBROU"/> <levelRef name="year" schema="CLBROU"/> </dimension> <cubeDimension name="CustSex (OLMDGB4P)" schema="CLBROU" businessName="CustSex" createTime="2004-12-22T21:35:31" creator="CLBROU" modifyTime="2004-12-22T21:35:32" modifier="CLBROU"> <dimensionRef name="CustSex" schema="CLBROU"/> <cubeHierarchyRef name="CustSex (OLMDGB4P)" schema="CLBROU"/> </cubeDimension> <cubeDimension name="Product (OLMDGB4P)" schema="CLBROU" businessName="Product" createTime="2004-12-22T21:35:31" creator="CLBROU" modifyTime="2004-12-22T21:35:32" modifier="CLBROU"> <dimensionRef name="Product" schema="CLBROU"/> <cubeHierarchyRef name="product (OLMDGB4P)" schema="CLBROU"/> </cubeDimension> <cubeDimension name="Time (OLMDGB4P)" schema="CLBROU" businessName="Time" createTime="2004-12-22T21:35:32" creator="CLBROU" modifyTime="2004-12-22T21:35:32" modifier="CLBROU"> <dimensionRef name="Time" schema="CLBROU"/> <cubeHierarchyRef name="time (OLMDGB4P)" schema="CLBROU"/> </cubeDimension> <measure name="TOTAL (SPSALALL)" schema="CLBROU" businessName="TOTAL (SPSALALL)" createTime="2004-12-22T21:33:26" creator="CLBROU"> <datatype schema="SYSIBM" name="DOUBLE" length="8" scale="0" nullable="yes"/> <sqlExpression template="{$$1}"> <column name="TOTAL" tableSchema="CLBROU" tableName="SPSALALL"/> </sqlExpression> <aggregation function="SUM"> </aggregation> </measure> <measure name="QTY (SPSALALL)" schema="CLBROU" businessName="QTY (SPSALALL)" createTime="2004-12-22T21:33:26" creator="CLBROU"> <datatype schema="SYSIBM" name="DOUBLE" length="8" scale="0" nullable="yes"/> <sqlExpression template="{$$1}"> <column name="QTY" tableSchema="CLBROU" tableName="SPSALALL"/> </sqlExpression> <aggregation function="SUM"> </aggregation> </measure> <facts name="SPSALALL" schema="CLBROU" businessName="SPSALALL" createTime="2004-12-22T21:33:26" creator="CLBROU"> <measureRef name="QTY (SPSALALL)" schema="CLBROU"/> <measureRef name="TOTAL (SPSALALL)" schema="CLBROU"/> <attributeRef name="CUST_ID (SPSALALL)" schema="CLBROU"/> <attributeRef name="DATE_ID (SPSALALL)" schema="CLBROU"/> <attributeRef name="PROD_ID (SPSALALL)" schema="CLBROU"/> <attributeRef name="PROMO_ID (SPSALALL)" schema="CLBROU"/> <attributeRef name="TERMS_ID (SPSALALL)" schema="CLBROU"/> </facts> <cubeFacts name="SPSALALL (OLMDGB4P)" schema="CLBROU" businessName="SPSALALL" createTime="2004-12-22T21:35:32" creator="CLBROU" modifyTime="2004-12-22T22:53:04" modifier="CLBROU"> <measureRef name="TOTAL (SPSALALL)" schema="CLBROU"/> <measureRef name="QTY (SPSALALL)" schema="CLBROU"/> <factsRef name="SPSALALL" schema="CLBROU"/> </cubeFacts> <cubeModel name="DB2SALESMDL" schema="CLBROU" businessName="DB2SALESMDL" createTime="2004-12-22T21:33:27" creator="CLBROU">

47

Page 50: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment <factsRef name="SPSALALL" schema="CLBROU"/> <dimensionInfo> <dimensionRef name="CustEducation" schema="CLBROU"/> <joinRef name="SPSALALL-SDCUST" schema="CLBROU"/> </dimensionInfo> <dimensionInfo> <dimensionRef name="CustMVHH" schema="CLBROU"/> <joinRef name="SPSALALL-SDCUST" schema="CLBROU"/> </dimensionInfo> <dimensionInfo> <dimensionRef name="Customer" schema="CLBROU"/> <joinRef name="SPSALALL-SDCUST" schema="CLBROU"/> </dimensionInfo> <dimensionInfo> <dimensionRef name="CustSex" schema="CLBROU"/> <joinRef name="SPSALALL-SDCUST" schema="CLBROU"/> </dimensionInfo> <dimensionInfo> <dimensionRef name="Product" schema="CLBROU"/> <joinRef name="SPSALALL-SDPROD" schema="CLBROU"/> </dimensionInfo> <dimensionInfo> <dimensionRef name="Promotion" schema="CLBROU"/> <joinRef name="SPSALALL-SDPROMO" schema="CLBROU"/> </dimensionInfo> <dimensionInfo> <dimensionRef name="Terms" schema="CLBROU"/> <joinRef name="SPSALALL-SDTERMS" schema="CLBROU"/> </dimensionInfo> <dimensionInfo> <dimensionRef name="Time" schema="CLBROU"/> <joinRef name="SPSALALL-SDTIME" schema="CLBROU"/> </dimensionInfo> </cubeModel> <cube name="OLMDGB4P" schema="CLBROU" businessName="OLMDGB4P" createTime="2004-12-22T21:35:32" creator="CLBROU" modifyTime="2004-12-22T22:53:29" modifier="CLBROU"> <cubeModelRef name="DB2SALESMDL" schema="CLBROU"/> <cubeFactsRef name="SPSALALL (OLMDGB4P)" schema="CLBROU"/> <cubeDimensionRef name="CustSex (OLMDGB4P)" schema="CLBROU"/> <cubeDimensionRef name="Product (OLMDGB4P)" schema="CLBROU"/> <cubeDimensionRef name="Time (OLMDGB4P)" schema="CLBROU"/> <optimizationSlice type="molapextract"> <optimizationLevel> <cubeDimensionRef name="CustSex (OLMDGB4P)" schema="CLBROU"/> <cubeHierarchyRef name="CustSex (OLMDGB4P)" schema="CLBROU"/> <cubeLevelRef name="sex (OLMDGB4P)" schema="CLBROU"/> </optimizationLevel> <optimizationLevel> <cubeDimensionRef name="Product (OLMDGB4P)" schema="CLBROU"/> <cubeHierarchyRef name="product (OLMDGB4P)" schema="CLBROU"/> <cubeLevelRef name="category (OLMDGB4P)" schema="CLBROU"/> </optimizationLevel> <optimizationLevel> <cubeDimensionRef name="Time (OLMDGB4P)" schema="CLBROU"/> <cubeHierarchyRef name="time (OLMDGB4P)" schema="CLBROU"/> <cubeLevelRef name="quarter (OLMDGB4P)" schema="CLBROU"/> </optimizationLevel> </optimizationSlice> </cube> </olap:metadata>

48

Page 51: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Appendix D: Test Files The following files represent the two tests that were submitted to SAS OLAP Server via a custom, test-driver application.

Test – olmdgb4p /*********************** OLAP TEST LIBRARY ****************** * * NAME: olmdgb4p * PURPOSE: Basic test mdx function: Extract/Crossjoin/TopCoun *****************************************************************/ TITLE1 'olmdgb4p: Basic test mdx function: Extract/Crossjoin/TopCoun'; options sastrace=',,,d' sastraceloc=saslog nostsuffix; /* Usually, your macro for OLAPCON will be set either on the SDSTEST command line or in your autofile. If you want to use personal settings, uncomment the following lines and change the appropriate values to your connection string. */ /*%let OLAPCON=%str(host=cubesvr01 service=olap1 user=USERID pass=xxx); */ %let OLAPCON=%str(host=localhost port=5451 user=sasadm pass=xxxxxx); proc sql noerrorstop; connect to olap (&OLAPCON); create table temp1 as select * from connection to olap ( WITH SET Top8Tuples AS 'TopCount ( Crossjoin ( { [Product].[Category].Members }, { [CustSex].[Sex].Members } ), 8, ( [Measures].[Total], [TIME].[All TIME].[1999] ) )' SELECT { [Time].[All Time].[1999], [TIME].[All TIME].[1998].[Q1, 1998], [Time].[All Time].[1998].[Q2, 1998], [Time].[All Time].[1998].[Q3, 1998], [Time].[All Time].[1998].[Q4, 1998] } on axis (0), Extract ( [Top8Tuples], [Product] ) on axis (1) FROM [DB2Sales] WHERE ( [Measures].[Total] ) ); disconnect from olap; quit; proc contents data=temp1;run; proc print data=temp1;run; /*+-------------------------------------------------------------+ | SAS TEST LIBRARY TRAILER | UPDATE: +-------------------------------------------------------------+*/

49

Page 52: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

Test – olmdgb5h /*********************** OLAP TEST LIBRARY ****************** * * NAME: olmdgb5h * PURPOSE: Basic test mdx function: Order Tuples, DES *****************************************************************/ TITLE1 'olmdgb5h: Basic test mdx function: Order Tuples, DES'; /* Usually, your macro for OLAPCON will be set either on the SDSTEST command line or in your autofile. If you want to use personal settings, uncomment the following lines and change the appropriate values to your connection string. */ /*%let OLAPCON=%str(host=cubesvr01 service=olap1 user=USERID pass=xxx); */ %let OLAPCON=%str(host=localhost port=5451 user=sasadm pass=xxxxxxx); options sastrace=',,,d' sastraceloc=saslog nostsuffix; proc sql noerrorstop; connect to olap (&OLAPCON); create table temp1 as select * from connection to olap ( WITH MEMBER [Measures].[Total Product Parent] AS '( [Measures].[Total], [Product].CurrentMember.Parent )' MEMBER [Measures].[Total CS Parent] AS '( [Measures].[Total], [CustSex].CurrentMember.Parent )' MEMBER [Measures].[Total PCS Parent] AS '( [Measures].[Total], [Product].CurrentMember.Parent, [CustSex].CurrentMember.Parent )' SELECT { ([Measures].[Total Product Parent], [Time].[All Time].[1999] ), ([Measures].[Total CS Parent], [Time].[All Time].[1999] ), ([Measures].[Total PCS Parent], [Time].[All Time].[1999] ), Crossjoin ( { [Measures].[Total] }, { [Time].[All Time].[1999], [TIME].[All TIME].[1998].[Q1, 1998], [Time].[All Time].[1998].[Q2, 1998], [Time].[All Time].[1998].[Q3, 1998], [Time].[All Time].[1998].[Q4, 1998] } ) } on axis (0), Order ( Crossjoin ( { [Product].[Category].Members }, { [CustSex].[Sex].Members } ), ( [Measures].[Qty], [Time].[All Time].[1999] ), DESC ) on axis (1) FROM [DB2Sales] ); disconnect from olap; quit; proc contents data=temp1;run; proc print data=temp1;run; /*+-------------------------------------------------------------+ | SAS TEST LIBRARY TRAILER | UPDATE: +-------------------------------------------------------------+*/

50

Page 53: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

References Hoffman, Virginia. (To be published in 2005). “DB2 and DB2 Cube Views Best Practices for MQT Design Using Model-Based and Workload-Based Advisors. IBM.

Note: The preceding Best Practices paper was in final review when this paper was published. Look for it on the IBM Web site at http://www.ibm.com.

Resources IBM. “DB2 Cube Views: A Primer”. IBM Redbook SG24-7002-00, September 5, 2003. Available http://www.redbooks.ibm.com/abstracts/sg247002.html?Open.

IBM. “DB2 UDB's High-Function Business Intelligence in e-Business”, IBM Redbook SG24-6546-00, September 17, 2002. Available http://www.redbooks.ibm.com/abstracts/sg246546.html?Open.

IBM DB2 UDB Online Documentation Documentation is shipped with DB2 UDB for local installation and is also available at http://publib.boulder.ibm.com/infocenter/db2help/index.jsp.

Kuznetsov, Alexander. "Using Materialized Query Tables to Speed Up Queries in DB2 UDB”, IBM developerWorks, August 22, 2002. Available http://www-106.ibm.com/developerworks/db2/library/techarticle/0208kuznetsov/0208kuznetsov.html.

To Find Out More For more information about DB2 UDB, DB2 Cube Views, and SAS®9, contact your SAS or your IBM Sales Representative, or the IBM International Competency Center at SAS ([email protected]).

51

Page 54: IBM DB2 Cube Views .and .DB2 Materialized Query Tables .in a ...

IBM DB2 Cube Views and DB2 Materialized Query Tables in a SAS®

Environment

52

© Copyright IBM Corporation 2005 IBM Corporation Software Group Route 100 Somers, New York 10589 Produced in the United States May 2005 All Rights Reserved No part of this document may be reproduced or transmitted in any form without written permission from IBM Corporation. Product data has been reviewed for accuracy as of the date of initial publication. Product data is subject to change without notice. This information could include technical inaccuracies or typographical errors. IBM may make improvements and/or changes in the product(s) and/or programs(s) at any time without notice. The performance data contained herein was obtained in a controlled, isolated environment. Actual results that may be obtained in other operating environments may vary significantly. While IBM has reviewed each item for accuracy in a specific situation, there is no guarantee that the same or similar results will be obtained elsewhere. References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business. Any reference to an IBM Program Product in this document is not intended to state or imply that only that program product may be used. Any functionally equivalent program, that does not infringe IBM’s intellectually property rights, may be used instead. It is the user’s responsibility to evaluate and verify the operation of any non-IBM product, program or service. All statements regarding IBM future direction and intent are subject to change or withdrawal without notice and represent goals and objectives only. The information provided in this document is distributed "AS IS" without any warranty, either express or implied. IBM EXPRESSLY DISCLAIMS any warranties of merchantability, fitness for a particular purpose OR non-INFRINGEMENT. IBM shall have no responsibility to update this information. IBM products are warranted according to the terms and conditions of the agreements (e.g., IBM Customer Agreement, Statement of Limited Warranty, International Program License Agreement, etc.) under which they are provided. IBM is not responsible for the performance or interoperability of any non-IBM products discussed herein. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. The provision of the information contained herein is not intended to, and does not; grant any right or license under any IBM patents or copyrights. Inquiries regarding patent or copyright licenses should be made, in writing, to: IBM Director of Licensing IBM Corporation North Castle Drive Armonk, NY 10504-1785 U.S.A. Trademarks The following terms are trademarks of International Business Machines Corporation in the United States, other countries, or both: AIX, AIX 5L, DB2, IBM, Enterprise Storage Server, eServer, FAStT, i5/OS, iSeries, i5, Micro-Partitioning, OpenPower, OS/390, OS/400, POWER5, pSeries, p5, RS/, S/390, Tivoli, TotalStorage, xSeries, z/OS, xSeries, zSeries. Other company, product or service names may be trademarks or service marks of others.