IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Choice of data loading - problem


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kanisha_prabha

New User


Joined: 10 Mar 2006
Posts: 26

PostPosted: Sat Dec 05, 2009 6:52 pm
Reply with quote

Hi,
A particular DB2 table has around 20 million records. This table needs to be updated with around 10 million records which exist in a flat file. Some of the data in the file will be updates to the table (against inserts). Note that in case of updates, the file records must be updated to the existing table data. There are 2 ways to accomplish this -

1. Unload the table data to another flat file. Perform a file matching logic to check updates against inserts. Create one file containing, original un-affected table records, update records and new inserts. Then load replace or resume no the table.

2. Use fileaid with SQL INSERT option to directly update/insert into the table.

I also have to keep tab of how many records got updated and how many were inserted after the load is done.

Given the above scenario, which method should I use? Which method will be faster? If I am using method 2, can I capture the record count for updates and inserts and report the same? Are there any other method that is more suitable and I am ignoring?

Thanks.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Sat Dec 05, 2009 8:40 pm
Reply with quote

use method one...
as a rule of the thumb when more than 30% of the <things> are processed
a sequential match approach will be faster

apart the issues related to locking, commits, backouts and so on
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Dec 05, 2009 11:02 pm
Reply with quote

Hello,

Individual inserts are high-overhead activity. Every row of data and all of the indexes have to be handled for each insert.

If unload/reload is used (in addition to the potentially substantial processing improvement), the completely reloaded data will usually provide better performance when subequently used.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
Search our Forums:

Back to Top