| Author |
MS-SQL - Should i index the column?
|
Sajee Joseph
Ranch Hand
Joined: Jan 17, 2001
Posts: 200
|
|
hello all, I have a Query on MS-SQL server. Consider that i have a table 'Master' and a field 'Name' in the table. If i have a Queru where i use 'Name' in the where clause. There are around 100000 entries in the table & the data is in such a way that almost all entries are repeated around 1000 times. Will it be helpful if i index this column?? Thanks, Sajee Joseph.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26173
|
|
Sajee, Yes an index would be helpful. Do all of your queries return 1000 rows or do you use another column as search criteria? If you use another column, consider creating an index with two columns.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Jason Steele
Ranch Hand
Joined: Apr 25, 2003
Posts: 100
|
|
Sajee, Anytime you plan to use a field in a where clause you should create an index for that field. This is standard practice and will ensure more rapid query execution in larger table sizes.
|
An egg is a chicken's house!
|
 |
 |
|
|
subject: MS-SQL - Should i index the column?
|
|
|