If I have a tables like...
tblResource
-----------
id
r_name
tblCategory
--------
id
c_name
tblTag
-------
id
t_name
tblResCatTag
------------
r_id
c_id
t_id
I have read only single indexes are read on tables, and the order of the values is important, so if I index tblResCatTag like...
ADD INDEX (rid, cid, t_id);
and have a query like...
SELECT r.r_name, c.c_name, t.t_name
FROM tblResource r
LEFT OUTER JOIN tblResCatTag rtc ON r.id = rtc.r_id
LEFT OUTER JOIN tblCategory c ON rtc.c_id = c.id
LEFT OUTER JOIN tblTag t ON rtc.t_id = t.id
Will the index get used in the last two joins, or will it be ignored since rid is the first item in the index?
EXPLAIN
the query?