How do database indexes work?
Let’s start out our tutorial and explanation of why you would need a database index
by going through a very simple example.
Suppose that we have a database table called
Employee with three columns – Employee_Name, Employee_Age, and
Employee_Address.
Assume that the Employee table has thousands of rows.
Now, let’s say that we want to run a query to find all the details of any employees who
are named ‘Jesus’?
So, we decide to run a simple query like this:
SELECT * FROM Employee
WHERE Employee_Name = 'Jesus'