Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
i googled web for indexing ..
and only that i understand properly

is

for creating index

SQL
create index MyIndex ON companytbl(companyId)


and for using it i have to use given below
select * from companytbl with (Index(MyIndex))


i have not seen any effect of this query ..



can any one tell is it right ...
there are also given clustered , non clustered index ... what is it with example ...

Thanks in advance .. iam unable to find out corrct material for this
Posted

Quote:
i have not seen any effect of this query ..
You could see the effect when the table has massive data. And see the Execution plan[^] for behind the scene(s)

Check this article
Database performance optimization part 1 (Indexing strategies)[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 24-Dec-13 2:42am    
Agree, a 5.
—SA
Maciej Los 24-Dec-13 3:11am    
+5
An index means that your database doesn't need to compare each row to find the values you want. Imagine you have book and you want to find something in it. You look in the index, right ? This is the same. Indexes on key columns ( ones you query a lot ) will make your DB a LOT faster. A DB without indexes is one step away from a heap.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900