If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > Urgent !! Help-Need to make the procedure faster(currently it is running for 4 days).

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-13-10, 05:53
suhel_2112 suhel_2112 is offline
Registered User
 
Join Date: Sep 2009
Posts: 7
Urgent !! Help-Need to make the procedure faster(currently it is running for 4 days).

/*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

*/
Attached Files
File Type: txt Sent2Forum.txt (30.7 KB, 61 views)

Last edited by suhel_2112; 02-13-10 at 06:18.
Reply With Quote
  #2 (permalink)  
Old 02-15-10, 06:34
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,258
I assume you have indexes to avoid table scan? Check showplan for the queries in the proc.

Generally you should first avoid cursors and then avoid unnecessary use of temp tables.

Instead of trying to understand your code, can you explain in English what the code is supposed to do?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On