Sunteți pe pagina 1din 6

(1) Create a PLAN_TABLE in the default database.

Ensure that your userID owns the


object it creates , making it the SCHEMA . Here is the complete DDL .
(2) Browse the newly created Plan_Table . It should be empty.

(3) Select a Table with data. The table T_NLTR_TRD is selected whose creator is
NLD1DBO . This table has following indexes defined on it .
NLTRCU00
NLTRNN01
NLTRNN02

NLTRCU00 has following columns in it .


TRD_SYMB
TRD_DT
ACCT_NBR
ORD_NBR
ORIG_ID

NLTRNN01 has following columns in it .


TRD_STAT

NLTRNN02 has following columns


DAYOLD_IND
(3) Create a SPUFI member for running dynamic EXPLAIN PLAN
EXPLAIN PLAN SET QUERYNO =1
FOR
SELECT * FROM NLD1DBO.T_NLTR_TRD
WHERE TRD_SYMB = ? AND
TRD_DT> ? AND
ACCT_NBR = ? ;

This is a EXPLAIN PLAN with Page Range predicate . This means that any column after
the Page Predicate should not be matched in the search for the data for this SQL to
execute.

(4) To validate the PLAN table browse through the newly populated value in it . Or
run this SPUFI to test it .

SELECT ACCESSTYPE , MATCHCOLS, ACCESSNAME FROM


A367123.PLAN_TABLE
WHERE QUERYNO=1 ;

The result is :
---------+---------+---------+---------+---------+---------+
ACCESSTYPE MATCHCOLS ACCESSNAME
---------+---------+---------+---------+---------+---------+
I 2 NLTRCU00
DSNE610I NUMBER OF ROWS DISPLAYED IS 1

S-ar putea să vă placă și