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.

The accounting class 1 and class 2 CPU and elapsed times <strong>for</strong> triggers, stored procedures,<br />

and user-defined functions are accumulated in separate fields and exclude the time<br />

accumulated in other nested activity.<br />

For more details, see Chapter 24. Analyzing per<strong>for</strong>mance data in the <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong><br />

<strong>Version</strong> 8 Administration Guide, SC18-7413.<br />

Inserts activated the trigger 100 times but WHEN condition true once<br />

Figure 3-41 shows the measurement when 100 inserts activated the trigger 100 times but 99<br />

times the WHEN condition evaluated false.<br />

100 Inserts activated Trigger 100 times<br />

but WHEN condition evaluated to true only once<br />

SQL DML TOTAL<br />

-------- --------<br />

SELECT 100<br />

INSERT 100<br />

UPDATE 1<br />

DELETE 0<br />

DESCRIBE 100<br />

DESC.TBL 0<br />

PREPARE 100<br />

OPEN 0<br />

FETCH 0<br />

CL<strong>OS</strong>E 0<br />

DML-ALL 401<br />

<strong>DB2</strong> V7 - workfile activity<br />

BP1 BPOOL ACTIVITY TOTAL<br />

--------------------- --------<br />

BPOOL HIT RATIO (%) 100<br />

GETPAGES 600<br />

GETPAGES-FAILED 0<br />

BUFFER UPDATES 400<br />

SYNCHRONOUS WRITE 0<br />

SYNCHRONOUS READ 0<br />

SEQ. PREFETCH REQS 100<br />

LIST PREFETCH REQS 0<br />

DYN. PREFETCH REQS 0<br />

PAGES READ ASYNCHR. 0<br />

Figure 3-41 SQL and BPOOL activity - Trigger with WHEN true only once<br />

<strong>DB2</strong> V8 - workfile activity<br />

BP1 no use reported<br />

The execution of 100 inserts caused the shown amount of work files activity, to actually<br />

execute the update in just one case. The 100 SELECTs shown in the accounting are due to<br />

the WHEN condition which causes 100 SELECTs to a DUMMY TABLE.<br />

In V7 the buffer pool BP1 used by the work files indicates 600 getpages and 400 buffer<br />

updates. In this case there was no activity related to the work files in V8.<br />

Figure 3-42 compares the CPU times when executing triggers in V7 and V8 and the WHEN<br />

condition is evaluated to true only once.<br />

The figure shows that the CPU used <strong>for</strong> non-nested was reduced 8.3% and the CPU to<br />

execute the trigger is reduced by a more visible 24%.<br />

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

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

Saved successfully!

Ooh no, something went wrong!