MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Define index on a column

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Siddheart22
Beginner


Joined: 11 Apr 2005
Posts: 42
Topics: 19
Location: India

PostPosted: Tue Aug 23, 2005 3:34 am    Post subject: Define index on a column Reply with quote

hi,

I need to decide which all columns should be used to create indexes on a table.
I realise that it depends on the WHERE predicates, but I need to know hw much it helps in case of and IN or LIKE clause.

Please post any info related to this

Cheers
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Tue Aug 23, 2005 3:49 am    Post subject: Reply with quote

Siddheart22,

The rule of thumb for table design is, if you are going to search on a column, create an index on that column . "search on a column" is actually one of several criteria for creating an index.

consider creating an index if the column is used in


    - the WHERE clause (i.e. to search on)
    - the WHERE clause or ON conditions (to join tables)
    - the GROUP BY or ORDER BY clauses


one caveat for creating indexes is whether in fact they would actually be used.

suppose there *is* an index on surname, but you wanted to go LIKE '%d
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Siddheart22
Beginner


Joined: 11 Apr 2005
Posts: 42
Topics: 19
Location: India

PostPosted: Wed Aug 24, 2005 12:29 am    Post subject: Reply with quote

Thanks Kolusu Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group