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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

an online transaction with very simple SQL statements each accessing and retrieving one<br />

row, the overhead can be about 1% if there is no other transaction running. On the other<br />

hand, if there are many concurrent transactions, we have heard of up to 15% overhead. A<br />

20% figure is <strong>for</strong> a projected maximum number <strong>for</strong> 32-way complex with many concurrent<br />

threads.<br />

In <strong>DB2</strong> V8, the overhead is thought to be completely negligible as there is no longer SMF 89<br />

data collection <strong>for</strong> each SQL statement.<br />

We there<strong>for</strong>e recommend you select SMF89 YES only if you use measured usage pricing.<br />

4.13.4 Lock avoidance enhancements<br />

We briefly describe the main lock avoidance enhancements.<br />

Overflow lock avoidance<br />

Sometimes when you update a variable length row, <strong>DB2</strong> is not able to store the row on the<br />

original page. This happens when the size of the row has increased and it no longer fits on its<br />

original page. In order to avoid updating all the indexes that point to that row (each index entry<br />

contains a RID, which contains the original page number), a pointer record is created on the<br />

original page. The pointer record then points to the actual row. If a later update of the row<br />

decreases its size, it can be put back into its original page, again without any updates to the<br />

index.<br />

You can have variable length rows when:<br />

► Using variable length columns like VARCHAR and VARGRAPHIC<br />

► Using <strong>DB2</strong> data compression<br />

► Altering a table to add a column, but you have not per<strong>for</strong>med a REORG to materialize all<br />

the rows to have the new column<br />

► Using the new V8 online schema enhancements to enlarge the a columns data type, but<br />

you have not run REORG to materialize all the rows to the latest <strong>for</strong>mat<br />

The good thing about using the overflow pointer is that we avoid updating the indexes. The<br />

disadvantage is that we potentially double the number of data I/Os and getpage requests, and<br />

increase the number of lock and unlock requests. This can obviously impact per<strong>for</strong>mance.<br />

You can check whether or not overflow records exist by looking at the FARINDREF and<br />

NEARINDREF in<strong>for</strong>mation in SYS<strong>IBM</strong>.SYSTABLEPART. This in<strong>for</strong>mation is updated by<br />

running RUNSTATS and provides in<strong>for</strong>mation about the number of rows that have been<br />

relocated far from (> 16 pages) or near (< 16 pages) their “home” page. We recommend you<br />

run a REORG when (FARINDREF +NEARINDREF) exceed 5 to 10%. To reduce the amount<br />

of overflow rows, and hence the number of double I/Os, getpages, and lock and unlock<br />

requests, you can use a higher PCTFREE value (FREEPAGE does not help in this case).<br />

In V7, there is no lock avoidance on both the pointer record and the overflow record itself.<br />

With <strong>DB2</strong> <strong>Version</strong> 8, only the pointer is locked.<br />

Table 4-15 Lock avoidance of overflow record<br />

Isolation Level Cursor Stability<br />

with CURRENTDATA NO or YES<br />

214 <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong> <strong>Version</strong> 8 Per<strong>for</strong>mance <strong>Topics</strong><br />

V7 V8<br />

Lock and Unlock required <strong>for</strong> the pointer record YES YES<br />

Lock and Unlock required <strong>for</strong> the overflow record YES NO

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

Saved successfully!

Ooh no, something went wrong!