What does Plan Analyzer use to compare SQL to a prior version
search cancel

What does Plan Analyzer use to compare SQL to a prior version

book

Article ID: 12452

calendar_today

Updated On:

Products

Plan Analyzer for DB2 for z/OS

Issue/Introduction

What does the compare process use to compare SQL to a previous version?  Does it use the statement number or the text of the SQL or some other info?
How do complex joins get evaluated?  How sensitive Plan Analyzer for Db2 for z/OS (PPA) is to what changes in a program?

Resolution

1. PPA compares Explain SQL by matching the STMTNO. Obviously it tries to do exact matching first, then if that fails it does a 'proximity' check
and looks up and down the chain of statements looking for a similarly structured statement within the general proximity of the original.
But essentially everything start with the 2 lists (before and after) sorted by statement number, and so the comparison works best if
the ordering of the SQL within the program remains unchanged    

2. PPA does not take advantage of the QUERYNO when doing a compare.