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 > DB2 > alternates to Cusrsors to handle huge volume of data

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-08-11, 02:06
kayal kayal is offline
Registered User
 
Join Date: Sep 2011
Posts: 8
alternates to Cusrsors to handle huge volume of data

Hi all,

I'm new to DB2 and I my proc has to process some 3 million records. Can I use cursors for this. Will cursors handle such large volumes of data efficiently or will it hang coz it need to store all 3 million rec in temp memory. Do we have any other alternative in DB2 other than using cursors to process such huge data? Pls advise.


Thanks,
Kayal.
Reply With Quote
  #2 (permalink)  
Old 11-08-11, 02:31
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
all rows will not be loaded into memory
result sets will be created in temp. tablespace
I don't see how to handle this in other way..
it will take some time if the rows are all handled one by one ..
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 11-08-11, 03:54
kayal kayal is offline
Registered User
 
Join Date: Sep 2011
Posts: 8
Hi
Thanks for the reply. In my cursor I dont have any condition to get the result set, so entire table has to be handled by the cursor. Is there any spl keywords in cursors to fetch the result set every one lakh record and process and again fetch 1 lakh into memory?

Thanks,
Kayal
Reply With Quote
  #4 (permalink)  
Old 11-08-11, 04:49
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
if there is no predicate it will fetch from base table i presume and lock according the isolation level...
db2 will always bufferpools to transit the data
have you already run this process ?
is there a specific problem ?
be as precise as possible and add some additional info if so..
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #5 (permalink)  
Old 11-08-11, 06:03
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
What do you want to do with those 3 mio rows? Maybe you can push the processing into the database system and just retrieve the final result (or something close to it).

However, if you want to do the processing in your application yourself, this has a high chance to be simply slow.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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