Indexing in SQL

Let us understand how normal (without indexing) query runs. It basically traverse each rows one by one and when it finds the data it returns.
Without Index:
Without indexingSo suppose query is to find 50 , it will have to read 49 records as a linear search.
With Index:
enter image description here
When we apply indexing, the query will quickly find out the data without reading each one of them just by eliminating half of the data in each traversal like a binary search. 

Comments

Popular posts from this blog