View previous topic :: View next topic |
Author |
Message |
Siddheart22 Beginner
Joined: 11 Apr 2005 Posts: 42 Topics: 19 Location: India
|
Posted: Tue Aug 23, 2005 3:34 am Post subject: Define index on a column |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Tue Aug 23, 2005 3:49 am Post subject: |
|
|
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 |
|
|
Siddheart22 Beginner
Joined: 11 Apr 2005 Posts: 42 Topics: 19 Location: India
|
Posted: Wed Aug 24, 2005 12:29 am Post subject: |
|
|
Thanks Kolusu |
|
Back to top |
|
|
|
|