The database would have to go through all the records one by one, in the order they appear to search for the matching datasets. It will become more an

Pankaj Tanwar's Blog

submited by
Style Pass
2021-08-19 05:30:01

The database would have to go through all the records one by one, in the order they appear to search for the matching datasets. It will become more and more time consuming once the table size increases.

It’s almost like looking through the entire database with the human eye – very slow and not at all sleek. This is what is called a full table scan.

So here, indexing comes into picture. What indexing does is, sets up the column your search conditions are on, in a sorted order to assist in optimising query performance.

The main point of having a index is to cut down the number of records/rows in a table which needs to be examined by the database, to speed up the searching queries.

An index is a data structure, (most commonly its B-tree {Its balanced tree, not binary tree}) that stores the value for a specific column in a table.

The major advantage of B-tree is that the data in it is sortable. Along with it, B-Tree data structure is time efficient and operations such as searching, insertion, deletion can be done in logarithmic time.

Leave a Comment