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.

Alter Index Padding<br />

In a first test with a non-partitioned table with 17 columns and 1 index the following scenario is<br />

executed and measured:<br />

1. CREATE PADDED INDEX index on C1, C2 and C3, each column being VARCHAR(10)<br />

2. ALTER INDEX to NOT PADDED and REBUILD INDEX<br />

3. ALTER INDEX to PADDED and REBUILD INDEX<br />

4. CREATE NOT PADDED INDEX on C1, C2 and C3, each column being VARCHAR(10)<br />

After each step the CPU time is measured <strong>for</strong> the following SQL:<br />

FETCH C1, C2, C3... WHERE C1=’XXXXXXXX’ AND C2=’YYYYYYYY’<br />

The results of this measurement are shown in Figure 5-11.<br />

CPU microseconds<br />

30<br />

25<br />

20<br />

15<br />

10<br />

Fetch CPU time …Alter Index Padding<br />

5<br />

0<br />

(1) (2) (3) (4)<br />

padded padded => not padded not padded<br />

ix not padded => padded ix<br />

Fetch CPU time comparison<br />

(2) vs. (1) : +6%<br />

(3) vs. (1) : No difference<br />

(4) vs. (1) : -17%<br />

Figure 5-11 FETCH CPU time - Alter index padded<br />

Index only<br />

access<br />

► After ALTER of the index to NOT PADDED and REBUILD the CPU time <strong>for</strong> FETCH<br />

increased by 6% (2 vs. 1)<br />

► Altering the index back to PADDED shows no difference in FETCH CPU time compared to<br />

the original situation (3 vs. 1)<br />

► Compared to an index that was created originally with the keyword NOT PADDED there is<br />

a FETCH CPU time increase of 23% (2 vs. 4)<br />

► The impact of NOT PADDED versus PADDED evaluates to a CPU time decrease of 17%<br />

(4 vs. 1) due to index-only access which outweighs the more expensive VARCHARs index<br />

key processing<br />

Note that the access path after the change from PADDED to NOT PADDED did not change to<br />

index-only access.<br />

We repeated this measurement and included a rebind of the application after altering the<br />

index from PADDED to NOT PADDED. See Figure 5-12 <strong>for</strong> the results.<br />

(1)<br />

N<br />

Chapter 5. Availability and capacity enhancements 237<br />

(2)<br />

N<br />

(3)<br />

N<br />

(4)<br />

Y

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

Saved successfully!

Ooh no, something went wrong!