• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

MS-SQL - Should i index the column?

 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic