Let's use lastName
as an example.
Assuming that there are no duplicate last names in your DB (by chance, not because of a unique
), would there be any benefit to indexing this lastName
column?
The query that would be used to search would be something like SELECT * IN t WHERE lastName='Smith'
.
If every entry in the column is unique, then how can an index have an effect? Wouldn't it have to search every entry regardless?
Sorry, I am just learning about indexing and I would really like to understand it better.
Thanks.