/*Data Ware Housing Scenario*/
/*Adaptive Server Enterprise/12.5.4*/
/*Two base tables
-- THESE ARE IN SAME SERVER
SCORING..entity T1 (430000- RECORDS)
SCORING..DRV_SCOV2_PAR_SERVICES T2 (550000 - RECORDS)
SCORE_WORK..A_SCOV2_USAGE_REVENUE ( 32500000 - RECORDS)
Basic idea.. For each Entity in T1 there are many services in T2.
so in the code there are two cursors outer one for ENTITY. INNER FOR SERVICES.
Need Help.. escalation on head... somebody any idea, how to reduce execution time.. it is taking 4 days to complete..
There is parallelism that is, in production there will be 8 servers process records from entity table,so effectively there will be 700000 records per server..
But this itself is taking more than 2 days to complete.......
Critical part of the code is attached.. somebody please help
*/