Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple question : speeding up an ORDER BY

Status
Not open for further replies.

StevenK

Programmer
Joined
Jan 5, 2001
Messages
1,294
Location
GB
We have a SQL Server 7.0 database with a 'Company' table. One of the fields is 'CompanyName' and we have some screens in our application that show these results in this order (i.e. SELECT * FROM Company ORDER BY CompanyName). Now that we have a fully populated table we are taking a long while to run this query.
I guess if we are able to set up an index making use of the CompanyName field then this will speed up the running of the query.
This is a simple problem - hopefully someone can let me know how to speed this query up ?
Should we create a VIEW or use an INDEX ?
Thanks for any help in advance.
Steve
 
Without doubt an index.

Something like Company name is generally also a good candidate for being a clustered index as well.

Rick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top