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.

In addition, with V8, PQ89070 implements lock avoidance <strong>for</strong> a singleton SELECT statement<br />

with ISOLATION(CS) and CURRENTDATA(YES). Semantically, a singleton select with<br />

ISOLATION(CS) can avoid getting an S page or row lock regardless of the setting of the<br />

CURRENTDATA parameter, since the cursor is closed after the SELECT is processed.<br />

Lock avoidance <strong>for</strong> embedded SELECT or SELECT INTO<br />

Semantically, a SELECT INTO with ISOLATION(CS) should avoid getting an S page or row<br />

lock regardless of the setting of the CURRENTDATA(CD) option since the cursor is closed<br />

after the SELECT is processed. Currently, with ISO(CS) and CD(NO) we get LOCK<br />

AVOIDANCE but not with ISO(CS) and CD(YES).<br />

If <strong>DB2</strong> can determine that the data that it is reading has already been committed, it can avoid<br />

taking the lock altogether. For rows that do not satisfy the search condition, this lock<br />

avoidance is possible with CURRENTDATA(YES) or CURRENTDATA(NO). For a row that<br />

satisfies the search condition on such a SELECT, lock avoidance is possible with<br />

CURRENTDATA(YES) or CURRENTDATA(NO). For other rows that satisfy the search<br />

condition, lock avoidance is possible only when you use the option CURRENTDATA(NO).<br />

In a test case, executing a simple select statement in a loop (100k times), we have seen up to<br />

a 25% better elapsed time in V8 when compared to the run without lock avoidance. When<br />

compared to V7, V8 is 7% better with lock avoidance.<br />

Chapter 4. <strong>DB2</strong> subsystem per<strong>for</strong>mance 215

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

Saved successfully!

Ooh no, something went wrong!