Indexes in SQL Server
When and why should we use Indexes?? What are indexes basically?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manas MohapatraRank #182 · 13.2K reputationPosted Jul 24, 2015, 6:19 AM EDT
Manoj BhoirRank #599 · 4K reputationPosted Jul 24, 2015, 7:53 AM EDT
An index can be used to efficiently find all row matching some column in your query and then walk through only that subset of the table to find exact matches. If you don't have indexes on any column in the WHERE clause, the SQL server have to walk through the whole table and check every row to see if it matches, which may be a slow operation on big tables.
The index can also be a UNIQUE index, which means that you cannot have duplicate values in that column, or a PRIMARY KEY which in some storage engines defines where in the database file the value is stored.
Santhakumar MunuswamyRank #128 · 17.3K reputationPosted Jul 24, 2015, 11:56 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Jul 24, 2015, 11:23 PM EDT