sanjaydhol
Technical User
Thanks a lot for the last reply. I changed the VLDB property and it solve the problem. I have another question. And most probably it is something related with the same VLDB property. I have one report generated from two MSTR project( Identical projects). One is connecting to DB2 DW (Metadata is in ORACLE) and another one is using MS Sql server as DW(Metadata is MS Access).
In the report we have several metrics. For each one of these Metrics we have some aggregate function. Now in Sql server version the report SQL query it is doing the aggregate and then storing the result in temp table in one pass.
But in DB2 version it is doing the same in three two steps. First one taking the distinct values in one table then from that table it is doing the aggregate and storing it in another table and then from that it is doing the rest join.
I am attaching the SQL query portion for clarification.
SQL Server Version
select a11.MODEL_WO_NUM MODEL_WO_NUM,
a13.EQUIP_TD_CAT_CD EQUIP_TD_CAT_CD,
a13.CLIENT_ID CLIENT_ID,
count(a11.PEND_WO_COUNT_CD) WJXBFS1
into #ZZMD00
from WDW210_WO_TSK a11
left outer join WDW212_WO_AST_DTLS a12
on (a11.WO_TSK_ID = a12.WO_TSK_ID)
left outer join WDW201_EQ a13
on (a12.EQUIP_SEQ_NUM = a13.EQUIP_SEQ_NUM)
where (a11.PEND_WO_COUNT_CD in (1)
and a11.WORK_ORDER_TYPE_CD in ('PD')
and a13.EQUIPMENT_NAM in ('POLE-DISTRIBUTION ', 'POLE-TRANSM/DISTRN ')
and a11.MODEL_WO_NUM in ('28077720', '28077721', '28077722', '28068951')
and a13.EQUIP_TD_CAT_CD in ('Distribution'))
group by a11.MODEL_WO_NUM,
a13.EQUIP_TD_CAT_CD,
a13.CLIENT_ID
In DB2
select a15.REGION_NUM REGION_NUM,
a11.MODEL_WO_NUM MODEL_WO_NUM,
a13.EQUIP_TD_CAT_CD EQUIP_TD_CAT_CD,
a11.PEND_WO_COUNT_CD WJXBFS1
into session.ZZOT00
from WDWT.WDW210_WO_TSK a11
left outer join WDWT.WDW212_WO_AST_DTLS a12
on a11.WO_TSK_ID = a12.WO_TSK_ID
left outer join WDWT.WDW201_EQ a13
on a12.EQUIP_SEQ_NUM = a13.EQUIP_SEQ_NUM
left outer join WDWT.WDW101_EQ_TYPE a14
on a13.EQUIP_TYPE_ID = a14.EQUIP_TYPE_ID
left outer join WDWT.WDW103_HIERARCHY a15
on a13.HIERARCHY_ID = a15.HIERARCHY_ID
where (a14.EQUIP_TYPE_CD in ('POLE ')
and a14.EQUIP_SUB_TYP_CD in ('DF', 'SP', 'WC', 'WL', 'OT', 'UN', 'WP', 'TM')
and a13.EQUIPMENT_NAM in ('POLE-DISTRIBUTION ', 'POLE-TRANSM/DISTRN ', 'POLE-TRANSMISSION ')
and a11.WORK_ORDER_TYPE_CD in ('PD')
and a11.MODEL_WO_NUM in ('28077720', '28077721', '28077722', '28068951')
and a11.WO_STS_CD not in ('COMPLETE', 'CLOSED', 'CANCEL'))
select pa1.REGION_NUM REGION_NUM,
pa1.MODEL_WO_NUM MODEL_WO_NUM,
pa1.EQUIP_TD_CAT_CD EQUIP_TD_CAT_CD,
count(*) WJXBFS1
into session.ZZMD01
from session.ZZOT00 pa1
group by pa1.REGION_NUM,
pa1.MODEL_WO_NUM,
pa1.EQUIP_TD_CAT_CD
As it is doing some extra step in db2 hence the total report generation time is becoming more.
Will appreciate any help on this. Thanks Sanjay.
In the report we have several metrics. For each one of these Metrics we have some aggregate function. Now in Sql server version the report SQL query it is doing the aggregate and then storing the result in temp table in one pass.
But in DB2 version it is doing the same in three two steps. First one taking the distinct values in one table then from that table it is doing the aggregate and storing it in another table and then from that it is doing the rest join.
I am attaching the SQL query portion for clarification.
SQL Server Version
select a11.MODEL_WO_NUM MODEL_WO_NUM,
a13.EQUIP_TD_CAT_CD EQUIP_TD_CAT_CD,
a13.CLIENT_ID CLIENT_ID,
count(a11.PEND_WO_COUNT_CD) WJXBFS1
into #ZZMD00
from WDW210_WO_TSK a11
left outer join WDW212_WO_AST_DTLS a12
on (a11.WO_TSK_ID = a12.WO_TSK_ID)
left outer join WDW201_EQ a13
on (a12.EQUIP_SEQ_NUM = a13.EQUIP_SEQ_NUM)
where (a11.PEND_WO_COUNT_CD in (1)
and a11.WORK_ORDER_TYPE_CD in ('PD')
and a13.EQUIPMENT_NAM in ('POLE-DISTRIBUTION ', 'POLE-TRANSM/DISTRN ')
and a11.MODEL_WO_NUM in ('28077720', '28077721', '28077722', '28068951')
and a13.EQUIP_TD_CAT_CD in ('Distribution'))
group by a11.MODEL_WO_NUM,
a13.EQUIP_TD_CAT_CD,
a13.CLIENT_ID
In DB2
select a15.REGION_NUM REGION_NUM,
a11.MODEL_WO_NUM MODEL_WO_NUM,
a13.EQUIP_TD_CAT_CD EQUIP_TD_CAT_CD,
a11.PEND_WO_COUNT_CD WJXBFS1
into session.ZZOT00
from WDWT.WDW210_WO_TSK a11
left outer join WDWT.WDW212_WO_AST_DTLS a12
on a11.WO_TSK_ID = a12.WO_TSK_ID
left outer join WDWT.WDW201_EQ a13
on a12.EQUIP_SEQ_NUM = a13.EQUIP_SEQ_NUM
left outer join WDWT.WDW101_EQ_TYPE a14
on a13.EQUIP_TYPE_ID = a14.EQUIP_TYPE_ID
left outer join WDWT.WDW103_HIERARCHY a15
on a13.HIERARCHY_ID = a15.HIERARCHY_ID
where (a14.EQUIP_TYPE_CD in ('POLE ')
and a14.EQUIP_SUB_TYP_CD in ('DF', 'SP', 'WC', 'WL', 'OT', 'UN', 'WP', 'TM')
and a13.EQUIPMENT_NAM in ('POLE-DISTRIBUTION ', 'POLE-TRANSM/DISTRN ', 'POLE-TRANSMISSION ')
and a11.WORK_ORDER_TYPE_CD in ('PD')
and a11.MODEL_WO_NUM in ('28077720', '28077721', '28077722', '28068951')
and a11.WO_STS_CD not in ('COMPLETE', 'CLOSED', 'CANCEL'))
select pa1.REGION_NUM REGION_NUM,
pa1.MODEL_WO_NUM MODEL_WO_NUM,
pa1.EQUIP_TD_CAT_CD EQUIP_TD_CAT_CD,
count(*) WJXBFS1
into session.ZZMD01
from session.ZZOT00 pa1
group by pa1.REGION_NUM,
pa1.MODEL_WO_NUM,
pa1.EQUIP_TD_CAT_CD
As it is doing some extra step in db2 hence the total report generation time is becoming more.
Will appreciate any help on this. Thanks Sanjay.