Usage os Space function

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
sumesh.abraham
Participant
Posts: 153
Joined: Thu May 11, 2006 1:52 am
Location: Bangalore

Usage os Space function

Post by sumesh.abraham »

Hello all,

I am analyzing a paralel job for performance improvemnets. I have found that in the transformer stage there is a filter which does input column value <> Space(1). Is there any performance benefit in using Space(1) rather than directly checking cinput column value <> ' '
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is actually a cost, that of evaluating the function every row. So a comparison against the literal string will be slightly more efficient. Many instances of "slightly" add to a useful amount.

For a slightly more complex example, initialize a stage variable to the result of the function and do not have a derivation expression for that stage variable. That way the function is evaluated only once per run.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply