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.

► A single value is never broken into more than one interval, meaning that the<br />

maximum number of intervals is equal to the number of distinct values on the<br />

column. The maximum number of intervals cannot exceed 100, which is the<br />

maximum number that <strong>DB2</strong> supports.<br />

► Adjacent intervals sometimes skip values that do not appear in the table,<br />

especially when doing so avoids a large range of skipped values within an<br />

interval. For example, if the value 30 above has 1% frequency, placing it in<br />

the seventh interval would balance the percentage of rows in the sixth and<br />

seventh intervals. However, doing so would introduce a large skipped range<br />

to the seventh interval.<br />

► HIGHVALUE and LOWVALUE can be inclusive or exclusive, but an interval<br />

generally represents a non-overlapped value range.<br />

► NULL values, if any exist, occupy a single interval.<br />

► Because <strong>DB2</strong> cannot break any single value into two different intervals, the<br />

maximum number of intervals is limited to the number of distinct values in the<br />

column, and cannot exceed the <strong>DB2</strong> maximum of 100 intervals.<br />

Example of equal-depth histogram statistics<br />

Equal-depth Histogram cuts the whole value range so that each quantile has<br />

about the same number of rows. The important parameters to describe<br />

equal-depth histogram statistics includes the total number of quantiles (N) and<br />

<strong>for</strong> each quantile, the pair of LOWVALUE/HIGHVALUE, the number of distinctive<br />

values (CARD) and the frequency (or the number of rows). To give an example,<br />

on a table <strong>IBM</strong>_EMPLOYEE column YRS_OF_EXPERIENCE, it may have (N=7)<br />

quantiles, as shown in Table 4-1.<br />

Table 4-1 Histogram statistics example<br />

SEQ.NR LOWVALUE HIGHVALUE CARD FREQUANCY<br />

1 0 3 4 14%<br />

2 4 15 8 14%<br />

3 18 24 7 12%<br />

4 25 25 7 12%<br />

5 26 26 1 15%<br />

6 27 30 4 16%<br />

7 35 40 6 14%<br />

Chapter 4. Benefits of <strong>DB2</strong> 9 <strong>for</strong> <strong>SAP</strong> <strong>BI</strong> 47

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

Saved successfully!

Ooh no, something went wrong!