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.

Better filter factor estimation<br />

V7 PLAN_TABLE<br />

IXNAME METHOD MATCHCOL<br />

TSS on PLO<br />

CLAIX<br />

CLBIX<br />

BLAIX<br />

0<br />

1<br />

4<br />

4<br />

Figure 3-30 Better filter factor estimation<br />

0<br />

2<br />

1<br />

1<br />

V8 PLAN_TABLE<br />

IXNAME METHOD MATCHCOL<br />

TSS on PLO<br />

BLAIX<br />

CLBIX<br />

CLAIX<br />

0<br />

1<br />

1<br />

1<br />

0<br />

1<br />

This figure shows a join of four tables and two join predicates between tables PLO and CLA.<br />

The plan table <strong>for</strong> V7 shows a join of table PLO and CLA using NLJ that is followed by a join<br />

to table CLB and BLA using hybrid join.<br />

In <strong>DB2</strong> V8, the same queries allow the <strong>DB2</strong> optimizer to find a better access path applying<br />

earlier a better filtering factor. The sequence of join of four tables changes: table BLA, that<br />

was processed last, becomes the second table scanned using NLJ, as the tables that follow.<br />

In <strong>DB2</strong> V8, the hybrid join method is not used.<br />

The measurements of this example show:<br />

► Elapsed time = 56.4 seconds in V7 to 19.1 seconds in V8 (66% reduction, a factor of 3)<br />

► CPU time = 39.1 seconds in V7 to 12.4 seconds in V8 (68% reduction, a factor of 3.2)<br />

The improvement ratio can be even more significant in complex queries involving more tables<br />

and more predicates.<br />

Access path improvements - multi-column statistics<br />

Measurements on other queries from the sample workload show improvements in CPU time<br />

resulting from a better access path as shown in Figure 3-31.<br />

60<br />

50<br />

40<br />

30<br />

20<br />

10<br />

V7 DEGREE(1)<br />

V8 DEGREE(1)<br />

3X<br />

1<br />

0<br />

2 Elapsed sec CPU sec<br />

3.2X<br />

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

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

Saved successfully!

Ooh no, something went wrong!