zOs/SQL/EXPLAGRO
select max(bind_time) from cmnbatch.plan_table
where progName = 'YAVX016'
;
select * from cmnbatch.plan_view5a
where progName = 'YAVX016'
and queryno in (159)
and bind_time = '2008-11-17-16.51.59.801961'
order by applname, progname, queryNo, qblockno, planno
;
set current sqlid = 'A540769';
delete from plan_table;
explain plan set queryno = 111 for
SELECT h_res1.h_code as h_analyse
,sum(h_res1.h_val) as h_valReprt
,sum(h_res1.h_valComp) as h_valComp
,round(float(sum(h_res1.h_val))
/ float(4.23)
* 100,2) as h_perc
from
(select AssetMainClass as h_code
,coalesce(MktValInCompCcy,0)
+ AccrIntInCompCcy as h_valComp
,coalesce(MktValInReprtCcy,0)
+ AccrIntInReprtCcy as h_val
from oa1t.VAV150A2
Where ReprtUuid = ?
And PartitionId = ?
And ObjectTypeCd NOT IN(131,141)
And ((coalesce(MktValInReprtCcy,0)
+ AccrIntInReprtCcy) > 0)) as h_res1
group by h_res1.h_code
order by h_valComp desc
for fetch only
;
select * from plan_view5a
where queryno in ( 111, 222)
order by applname, progname, queryNo, qblockno, planno
;
rollback;