07.02.2013 Views

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

10.4 Indexing of InfoCubes<br />

The default indexes <strong>for</strong> an InfoCube facttable are generally sufficient <strong>for</strong> optimal<br />

query per<strong>for</strong>mance. This is especially true when combined with partition<br />

elimination that can be exploited by <strong>DB2</strong>, such as a query with a time restriction<br />

on a partitioned E facttable.<br />

The InfoCube query example shown in Figure 10-1 on page 204 actually<br />

contains a custom time dimension (D6), and there<strong>for</strong>e the query does not exploit<br />

the <strong>SAP</strong>-provided time dimension (referred to as DT in queries). Since E<br />

facttable partitioning is by the time characteristic, then InfoCubes with custom<br />

time dimensions may not benefit from partition elimination. This makes custom<br />

indexing a possible requirement.<br />

10.4.1 facttable indexing<br />

From Figure 10-1 on page 204, the filtering dimensions (in order of filtering) are<br />

D3, D6, and D1. A facttable index may be created to support the combined<br />

filtering, although you must consider the Cartesian product size of be<strong>for</strong>e<br />

facttable dimensions.<br />

After filtering, the dimension/snowflake sizes are:<br />

► D3 - 281<br />

► D6 - 37<br />

► D1 - 171,787<br />

A Cartesian product of D3 x D6 x D1 = 1.78 billion is not desirable. The size of<br />

the D1 snowflake is too large to include in a Cartesian product. Given that this<br />

dimension provides the least filtering of the three listed, this can be discarded in<br />

choosing the optimal post-facttable access.<br />

A Cartesian product of D3 x D6 = 10,397 is very desirable given the facttable size<br />

of 10 million rows. At most, the facttable will be probed 10,397 times from this<br />

Cartesian result (potentially less, if not all combinations of the two dimensions<br />

exist in the facttable).<br />

This query may benefit from an index on KEY_ZIC_SFC3, KEY_ZIC_SFC6.<br />

10.4.2 Index design <strong>for</strong> dimension/master data tables<br />

Indexes on dimension/master data tables provide two main functions:<br />

► Efficient data access and join per<strong>for</strong>mance<br />

► Easy statistics collection<br />

224 <strong>Best</strong> <strong>Practices</strong> <strong>for</strong> <strong>SAP</strong> <strong>BI</strong> <strong>using</strong> <strong>DB2</strong> 9 <strong>for</strong> z/<strong>OS</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!