aspose file tools
The moose likes JDBC and the fly likes MS-SQL - Should i index the column? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "MS-SQL - Should i index the column?" Watch "MS-SQL - Should i index the column?" New topic
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
    
  66

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!
 
jQuery in Action, 2nd edition
 
subject: MS-SQL - Should i index the column?
 
Similar Threads
Confusion in creating indexes
Pl/SQL Help-Procedures
Regarding index usage
Performance hit using "where" clause in the query
INSERT Issue