Some help with indexing please?
Hello. I am trying to understand indexing and i'm a bit stumped when it comes to joins.
I have two tables
A website table (Primary Key here is website_id)
A links table (Foreign Key here is website_id)
And every link in my links table belongs to a SINGLE website in the websites table so I perform a join on it
Here I have created an index on links.website_id, but when I run an EXPLAIN though for the above query it says what a possible key is (website_id) , but the columns for key and key_len are both null.
SELECT website.website_id, website.name, links.url
INNER JOIN website
ON website.website_id = links.website_id
Is that correct? If not what else would I need to index everything properly here in order to run the above query? Thank you