• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MS-SQL - Should i index the column?

 
Sajee Joseph
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 35276
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jason Steele
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic