Hi,
The query mention below is taking long time to execute can any body help me
out in perfromance tuning of the query
exec sql
Declare Cursor CUR1
Select A.C1, A.C2,A.C3,A.C4
from Tbl1 A, Tbl2 B, Tbl3 C
Where
-- Join Predicates
( A.C1 = B.C1 AND
A.C2 = B.C2 AND
A.C1 = C.C1 AND
A.C2 = C.C2 )
--end predicates
AND (C.Region =

CLGEN-REG)
AND (B.Date <> '00000000' )
AND
((B.Date <

clgen-date)
or
(B.Date >=

clgen-date
A.IND = 'Y'))
order by A.C1,A.C2,A.C3,A.C4
group by A.C1,A.C2,A.C3,A.C4
end-exec
All the tables have are accessed by the keys C1 and C2
and the table tbl1 is indexed by C1,C2,C3,C4
the Columns A.IND,C.Region and B.Date are not indexed and the DB2 plan is performing Table scan the Db2 table
Is that right to index this coulmns A.IND and Trig_dt.
A.IND will have only two value 'y' or 'N'.
How can I make my query give resultant data faster