19.06.2013 Views

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - 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.

► In memory work file which caches the data and index keys in a dedicated virtual memory<br />

pool<br />

Star join per<strong>for</strong>mance is dependent on the circumstances. Your mileage may vary.<br />

3.3.6 Recommendations<br />

The size of the in memory work file can be set on the installation panel DSNTIP8, parameter<br />

STAR JOIN MAX POOL.<br />

The in memory data caching <strong>for</strong> star join is most effective when the schema contains<br />

snowflakes. There<strong>for</strong>e, <strong>for</strong> the users whose star schema is highly normalized and has many<br />

snowflakes, a larger pool size would be recommended (<strong>for</strong> example, 256 MB), particularly<br />

when the <strong>DB2</strong> subsystem is dedicated to star schema workloads. This virtual storage is<br />

above the 2 GB bar and the real storage use is limited to only the pages touched, so there<br />

should be no significant penalty <strong>for</strong> those not using star joins and potentially much greater<br />

benefit <strong>for</strong> those using star joins.<br />

Note: An unfiltered snowflake may not be materialized in V8 in contrast to V7 where all<br />

snowflakes were materialized into work files.<br />

The sparse index support in inside-out phase and part of the new star join access path<br />

selection logic are included in APAR PQ61458 applicable to V7.<br />

After migrating to <strong>DB2</strong> V8, specify adequate amounts of memory <strong>for</strong> maximum pool size in<br />

DSNZPARM SJMXPOOL to gain the benefit of in memory work files in a dedicated virtual<br />

memory pool <strong>for</strong> star join.<br />

3.4 Stage 1 and indexable predicates<br />

Figure 3-24 shows one example of the execution of one SQL using index and shows the<br />

difference between Stage 1 and Stage 2 predicates, where Stage 1 predicates can be<br />

resolved sooner, without involving complex analysis.<br />

The SELECT statement reads all orders from the table TORDER that has order number<br />

between 15000 and 17000. <strong>DB2</strong> specifies the use of the index on column ORDERNO starting<br />

at key value 15000. <strong>DB2</strong> uses the index tree to find the leaf page containing the value 15000<br />

and scans <strong>for</strong>ward until it accesses the leaf page containing the value 17000. Then it stops<br />

the scan. GETPAGEs are issued <strong>for</strong> each index page referenced.<br />

In complex SQL statements with multiple predicates, they are applied in the sequence:<br />

1. Matching index predicate<br />

2. Other index key predicates applied<br />

3. All other stage 1 predicates<br />

4. All stage 2 predicates<br />

If the predicate is applied in the earlier stage, the per<strong>for</strong>mance is improved. If the predicate is<br />

used as an argument <strong>for</strong> a matching index, <strong>DB2</strong> does not need to read data pages not<br />

satisfying the predicate. On the other hand, if the predicate is stage 2, <strong>DB2</strong> has to read rows<br />

that do not satisfy the predicate and send them to further analysis.<br />

Chapter 3. SQL per<strong>for</strong>mance 65

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

Saved successfully!

Ooh no, something went wrong!