|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
which is better in terms of performance |
« View previous topic :: View next topic » |
Author |
Message
|
deepak_paul |
Posted: Mon Mar 08, 2010 11:58 am Post subject: which is better in terms of performance |
|
|
Centurion
Joined: 04 Oct 2008 Posts: 147 Location: US
|
If TRIM(InputField) <> '' THEN
OutputField=TRIM(InputField);
END IF;
Or
OutputField=NULLIF(TRIM(InputField),''); |
|
Back to top |
|
 |
deepak_paul |
Posted: Thu Mar 11, 2010 11:46 am Post subject: |
|
|
Centurion
Joined: 04 Oct 2008 Posts: 147 Location: US
|
|
Back to top |
|
 |
kimbert |
Posted: Thu Mar 11, 2010 3:02 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
It's a fair question, but it's pretty rare for anybody to ask about the performance of individual ESQL statements. Normally the throughput of a flow is dominated by transactional costs, database accesses, parsing etc.
I don't expect anybody knows the answer off the cuff - with the possible exception of mgk. I suggest that you use the time-honoured method of putting both into a loop and doing them a few million times each. |
|
Back to top |
|
 |
mgk |
Posted: Thu Mar 11, 2010 3:17 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Off the cuff I would say that the second will be faster . This is simply because in the first there are more ESQL statements to execute. However, I would not expect a significant difference between the two.
Note also there is a subtle difference between the two versions in the case where the InputField is ''. In the first OutputField will not be assigned the NULL value, whereas in the second it will be. This maybe what you want, I can't tell from your post.
Like kimbert says, if you really need to know, measure...
Kind Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|