I'm studying index
on MySql and I'm trying to understand how they work.
I learn some basic commands, like how to create an index, how to check indexes on a table, how to use explain
command etc.
My simple and stupid question is:
after I create and index, for example with
CREATE INDEX index_first_name ON contacts (id, first_name, last_name);
should I do something else to tell MySql
to "use" that index?
According to what I understood, MySql decides to use a specific "index" when there is a kind of "match" between the fields indexed and the "where" clause. Is is correct?
To take advantage of indexes, I just have to write a "standard" select
like
select first_name from contacts
, right?
Thank you