IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Instead of LIKE if a use IN, will it effect performance


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Wed Feb 07, 2007 12:05 pm
Reply with quote

Hi Guys,

with your experience can you please let me the answers for the below queries

1. If i reduce the lists of columns in the select clause in a query does it alter the performance (incerease/decrease)
2. Instead of LIKE if a use IN for a where clause will effect performance
(incerease/decrease)

Regards,
Jayaram
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Feb 07, 2007 2:13 pm
Reply with quote

rajandhla wrote:
1. If i reduce the lists of columns in the select clause in a query does it alter the performance (incerease/decrease)
No, it should not.
Quote:
2. Instead of LIKE if a use IN for a where clause will effect performance (incerease/decrease)
It depends upon the indexes.
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Wed Feb 07, 2007 3:19 pm
Reply with quote

Thanks For the prompt reply.........

One more query...

If i use relational operator instead of NOT NULL in where clause will it effect performance.....

ex : Instead of A is not NULL if i use A>0 will it effect performance
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Fri Feb 09, 2007 3:53 pm
Reply with quote

Quote:
1. If i reduce the lists of columns in the select clause in a query does it alter the performance (incerease/decrease)


I would say it will increase the performance(depends on how much data you are dealing with and the logic involved in the query). No need to fetch additional columns.

2. LIKE is used when you know the solution partially. Probably this will scan and read more values. IN is used when you know the full value. If that is a indexed column IN should increase the peroformance.

3. Once again performance does not depends on what values does A contain. It doesn't matter. It depends whether you query is going for Index scan or tablespace scan or something like that.
Back to top
View user's profile Send private message
Suryanarayana.tadala

New User


Joined: 03 Nov 2005
Posts: 43
Location: St.Louis

PostPosted: Fri Feb 09, 2007 10:08 pm
Reply with quote

I would say performance increases on the volume of data you are dealing with and the business that the query has ...but to be straight enough it woud be Yes Performance increases

2.Yes Performace is increased...

3. It depends whether you query is going for Index scan or tablespace scan or something like that.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts exploiting Z16 performance PL/I & Assembler 2
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts Which SORT utility can improve the Pe... DFSORT/ICETOOL 16
No new posts COBOL Performance Tuning COBOL Programming 6
No new posts CICS Performance statistics CICS 3
Search our Forums:

Back to Top