Poor performance when updating SQL Server table

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Poor performance when updating SQL Server table

Post by sbass1 »

Hi,

I'm implementing SCD2 processing against a target SQL Server table.

Excerpt from the job:

Code: Select all

xfm --> Update --> Target Table
xfm --> Close -->  Target Table
xfm --> Insert --> Target Table
where Update/Close/Insert links are from the same xfm and to the same Target Table. In other words, one xfm stage, 3 links, one target table stage.

I have to set the transaction size in the target table from 0 to 1 to prevent deadlocks. See viewtopic.php?t=128156&highlight=, although this is a different job and issue.

The current target table size is around 172K rows. For the scenario in this post, all transactions are updates, i.e. all rows are going down the Update link (I've just run the job twice - first was all inserts (with good performance), the second is all updates (with horrid performance)). This table will only get larger in production.

I'm getting horrendous performance in this scenario - around 5 rows/sec = 34400 sec = 573 mins = 9.5 hours to run!

Any advice in this scenario? Should I write each link to sequential files or working tables in SQL Server, then Update/Close/Insert from these? Or, since I'm updating all columns in the target table, would Replace Existing Rows Completely give better performance?

Thanks,
Scott
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues :-)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Silly question but we need to get this out of the way - is there an index over the 'key' column(s) in your update/close links?

And having to commit each transaction individually is a performance killer. We may have to look at a flat file approach, something like you posted if you can't get an acceptable performance from this otherwise.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Post by sbass1 »

I've had the DBA create appropriate indexes and the performance is now acceptable.

Thanks for the help...
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues :-)
Post Reply