ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Use of THE function

Post new topic  Reply to topic
 Use of THE function « View previous topic :: View next topic » 
Author Message
knowledge_thirsty
PostPosted: Thu Apr 17, 2008 4:21 am    Post subject: Use of THE function Reply with quote

Newbie

Joined: 07 Apr 2008
Posts: 2

Hi All,
I have a question . does the use of 'THE' function with select statement have any advantage in terms of performance in comparison to using only select statement?Or 'THE' is used only to select the first row from the List expression. I don't see anything in the documentaion regarding the performance issue.But wonder whether it improves the performance by stopping the selection whenever the first matching occurance found. Can anybody throw any light on this and provide me any useful link to know more about this particular function.

Thanks,
Back to top
View user's profile Send private message
Gaya3
PostPosted: Thu Apr 17, 2008 5:21 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

performance depends on your SELECT query rather than THE.

If you are using a simple/complex select statement, thats the required factor for performance checking

Regards
Gayathri
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
knowledge_thirsty
PostPosted: Thu Apr 17, 2008 5:47 am    Post subject: Reply with quote

Newbie

Joined: 07 Apr 2008
Posts: 2

Ok. I am using a simple select query like

SET employeeName.Result[] = select T.employee_name
FROM employee AS T
WHERE T.employee_id = '223344'

my question is, is there any difference in terms of performance in
the query above and the following query.

SET employeeName.Result[] = THE(select T.employee_name
FROM employee AS T
WHERE T.employee_id = '223344')

does the searching stop in the second case whenever the first match found?
Back to top
View user's profile Send private message
AJStar
PostPosted: Mon Apr 21, 2008 2:12 am    Post subject: Reply with quote

Acolyte

Joined: 27 Jun 2007
Posts: 64

knowledge_thirsty wrote:
SET employeeName.Result[] = select T.employee_name
FROM employee AS T
WHERE T.employee_id = '223344'

You are doing 2 things here (1) Query DB (2) Storing result
knowledge_thirsty wrote:
SET employeeName.Result[] = THE(select T.employee_name
FROM employee AS T
WHERE T.employee_id = '223344')

You are doing 3 things here (1) Query DB (2) using THE function (3) Storing result

knowledge_thirsty wrote:
my question is, is there any difference in terms of performance in the query above and the following query.

I would assume that it takes a fraction of second more for the second method.
knowledge_thirsty wrote:
does the searching stop in the second case whenever the first match found?

The "THE" function returns a non-list result, taking a list as argument (though not mandatorily a list). Your SELECT query is independent.
_________________
Regards
AJ
Back to top
View user's profile Send private message
mgk
PostPosted: Mon Apr 21, 2008 3:40 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

It is correct that the "THE" function is performed independently of the "SELECT". In the case you give (using a WHERE clause) I believe that AJStar is correct. Where "THE" can be faster is if your SELECT returns a long list with many rows (e.g. if you did not use a WHERE clause) and the cost of performing the "THE" will be outweighed by the cost of the assignment of the whole result set to a tree where you did not want the extra data.


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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Use of THE function
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.