Looking for design help

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Looking for design help

Post by abc123 »

My source dataset has duplicates on the key column, Col1. I need to insert the first one in a duplicate set as an insert and all subsequent ones as updates. I am using Oracle Connector stage. I set recordcount to 1 and I am using a single node config file. This works but my data volume is large and I am wondering if there is another strategy that anyone can suggest.

Thanks.
elsont
Participant
Posts: 16
Joined: Wed Oct 08, 2008 1:20 am
Location: Chicago

Re: Looking for design help

Post by elsont »

Hi,

You can use multi node config file if table is having row level locking. In this case use the hash partition on the key. My suggestion is to avoid hitting database multipile times for the same record again and again. try to create a single record(unique key) instead of hitting table again and again that will give more performance.
If your table is having page level lock, then you may not be able to hit the table with multi node (may create deadlock). but if you can separate inserts and updates, then you ccan run insert in parallel and updates sequentially after inserts are done.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Use a sort stage to sort your incoming data on KEY and create a key change column. In the subsequent transform change, output all records where the key change column is true to the DB "INSERT" link and the others to the DB "UPDATE" link. Both DB stage should have the appropriate insert or upsert SQL.
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

Arndw, so you are suggesting that all inserts happen at a time whereas all updates happen sequentially, one after one (RecordCount=1)?
Post Reply