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.

Several things worth noting are:<br />

► There may be skipped values between adjacent quantiles. If there are, then it<br />

means that those skipped values are of zero appearance in the table.<br />

► Each quantile has approximately the same number (or percentage) of rows.<br />

The highly frequent single value may alone by itself occupy a quantile. The<br />

single-value will not be broken into more than one quantiles. There<strong>for</strong>e, the<br />

number of quantiles maximum is equivalent to the number of distinct values in<br />

that column. However, <strong>DB2</strong> has a maximum limit of 100 quantiles <strong>for</strong> storage<br />

purposes.<br />

► One particular value may be included into a quantile just because it is closer<br />

to that quantile. The purpose is to avoid the skipped range as much as<br />

possible. For example, value 30 from above has frequency=1%, including it in<br />

the 6th quantile would make the fifth and sixth quantile with frequency=15%<br />

even. But doing that would introduce a large skipped range [28, 34] to the<br />

sixth quantile and we try to avoid that.<br />

► A special case of (3) is that HIGHVALUE or LOWVALUE, when it is too far<br />

away from the rest of the value range, the single value of HIGHVALUE or<br />

LOWVALUE will occupy a quantile by itself.<br />

► The NULL value will occupy a quantile by itself.<br />

► Due to aggregation, quantiles may not always have closed range, that is, the<br />

high value or low value can be inclusive or exclusive. But overall, the<br />

quantiles represent the non-overlapped value range.<br />

You will find more details about histogram statistics in the description of the<br />

corresponding system catalog tables (SYSCOLDIST, SYSCOLDISTSTATS,<br />

SYSKEYTGTDIST, and so on) and in the documentation <strong>for</strong> RUNSTATS.<br />

4.3 Parallelism enhancements<br />

This section discusses parallelism enhancements such as global query<br />

optimization, which enables <strong>DB2</strong> to optimize a query as a whole rather than as<br />

an independent part and cross query block optimization, which is optimization<br />

across, rather than within, query blocks.<br />

4.3.1 Global query optimization<br />

With <strong>DB2</strong> V8 the <strong>DB2</strong> optimizer chooses the lowest cost sequential plan and<br />

then determines how to parallelize the access path. With Version 9 the way of<br />

<strong>using</strong> parallelism has been extended. The V9 optimizer considers multiple<br />

sequential plans <strong>for</strong> parallelism and then executes the one with the lowest costs.<br />

48 <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!