Suppose you have a requirement where you should look up on the same table in more than one mapping and the corresponding sessions are in same workflow.
To improve performance of that workflow, you can check re-cache option in the mapping where the lookup will be executed for the first time. If you check Re-cache option in lookup, the lookup will create Cache in the mapping where you are using that lookup for the first time and other depending mappings will re-use the cache created by the first mapping.
With this re-usability of lookup cache, performance will be increased. To do this, we should set dependency between sessions in the workflow and check re-cache in first session.
I will explain you with an example.
I have below mappings:
1) m_PRESTGtoXREF_mbr_xref
2) m_PRESTGtoXREF_grp_contc_xref
3) m_PRESTGtoRARI_sbgrp_contc
And I have a lookup on table HCR3R_GRP_XREF and am using this in more than one mapping. In my workflow there is a dependency that m_PRESTGtoXREF_mbr_xref mapping should executed first and then m_PRESTGtoXREF_grp_contc_xref and m_PRESTGtoRARI_sbgrp_contc.
In m_PRESTGtoXREF_mbr_xref mapping, I set re-cache option as shown in below snapshot.
And am using same lookup in remaining two mappings also. You should check Re-cache option in first mapping only, you should not check in remaining mappings.
If you run the workflow then you can see the below in sessions logs of last two mappings.
Warning: Cache file was created by mapping [m_PRESTGtoXREF_mbr_xref] but is being reused by mapping [m_PRESTGtoXREF_grp_contc_xref]
If you see the above content in log then it is confirmed that re-cache option is working properly. Suppose, you could not see the above content and you could see
Lookup Transformation [r_lkp_HCR3R_GRP_XREF]: Default sql to create lookup cache: SELECT GRP_SK,GRP_ID,SS_CD FROM HCR3R_GRP_XREF ORDER BY GRP_ID,SS_CD
then it is confirmed that your re-cache option is not working properly. You should debug it in the mapping.
Note: Based on your table names, the log file content will be changed. Here, I pasted my session log.
Comments
Post a Comment