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.

<strong>BI</strong>C/A00) table. Keep in mind that this table also is<br />

involved in the activation of DataStore object data, so this must also be<br />

considered when deciding a partitioning scheme.<br />

To choose an appropriate partitioning key, you need to understand your data and<br />

know how it is used and how it is managed. You should focus on how the data is<br />

commonly retrieved. Look at which key figure fields the users are <strong>using</strong> in their<br />

queries. Next look at which of these key figure fields are local predicates on the<br />

DataStore object and which are joins to master data. Only fields in the local<br />

predicates should be considered as columns in the partitioning key.<br />

Unlike InfoCube queries, where <strong>SAP</strong> keeps a historical record of the InfoObjects<br />

referenced in a query in the table RSDDSTATAGGRDEF, you must trace (<strong>for</strong><br />

example, ST05) and examine the SQL of a DataStore object query in order to<br />

analyze how the DataStore object is used by queries.<br />

One common partitioning key <strong>for</strong> an DataStore object is date. This works if the<br />

data is commonly queried by date, <strong>for</strong> example, Display the sales volume by<br />

day or month. Partitioning by date also lends itself to data management. As time<br />

goes on, older data can be archived and deleted from the active DataStore<br />

object.<br />

In addition to adding the indexes to improve query per<strong>for</strong>mance, we also<br />

recommend partitioning /<strong>BI</strong>C/AZ<strong>OS</strong>ASALE00 by CALMONTH.<br />

If a greater number of partitions is required <strong>for</strong> reduced partition size or increased<br />

parallelism, then partitioning would be recommended by CURTYPE,<br />

CALMONTH. (Note, however, that the addition of CURTYPE as the leading<br />

partitioning column should only be made if CURTYPE always exists in queries<br />

against this DataStore object.)<br />

After you choose a partitioning key, you need to decide on the number of<br />

partitions and the limit key value <strong>for</strong> each partition. The number of partitions<br />

should be determined by the anticipated table growth. The limit key value should<br />

be determined by what will give evenly sized partitions.<br />

<strong>SAP</strong> provides a function (through transaction SE14) that collects limit key data<br />

based on a particular index. You specify an index and the desired number of<br />

partitions, and <strong>SAP</strong> determines the limit key value <strong>for</strong> each partition that will give<br />

evenly sized partitions.<br />

Of course, this strategy only works <strong>for</strong> tables that are populated with data. It also<br />

requires that an index exists that will be the partitioning index. To use this<br />

function with table-controlled partitioning, you may have to define an index <strong>for</strong><br />

your partitioning key. After <strong>using</strong> this index to collect the limit key data, you can<br />

drop the index if it is not needed <strong>for</strong> data access.<br />

Chapter 7. <strong>Best</strong> practices <strong>for</strong> DataStore 111

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

Saved successfully!

Ooh no, something went wrong!