Stage Variables..Curious on how it will affect performance

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
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Stage Variables..Curious on how it will affect performance

Post by cosec »

Is it better to use stage variables when you can do the same thing without using it ?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If you define a stage variable and then use that variable in only one derivation you will have a bit more overhead than by doing the computation directly in the derivation. If you use the stage variable result more than once (be it a derivation or a constraint or another stage variable) then is more efficient to do so. The performance differences may seem minor but really add up since they get executed for each row.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

I often use stage variables when I don't need to for complex derivation code. I don't think there is much overhead and it can really help to document and organize the code in the stage. You can for example add a comment and a naming convention to a stage variable.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I fall into the McBurney camp when it comes to stage variables, it seems. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply