Have you ever gone into a practical situation where you thought that the concept of INDEX could help getting out of a real time problem???
I guess I will get a majority of “NO”.
Here is a real time demonstration of how index can come as the only help improving the issue of time complexity in fetching records from a table. In his case the number of rows fetched reduced from 17443 to 81 in a JOIN query when used with index applied. Check below…
Is it possible that join only happens on those rows that have been returned from search in “Category” table.
explain select c.id from professional_categories as c inner join professionals as p on p.professional_category_id=c.id where c.professional_category_name like 'ABC%'
Below are the indices from professional table.
Check this link for the solution and comments on this.