J'ai du mal à faire en sorte que MySQL utilise des index sur de nombreuses requêtes, j'ai collé les informations relatives ci-dessous.Optimisation de plusieurs requêtes MySQL
EXPLAIN SELECT *
FROM interviews
JOIN interview_category_links ON interviews.id = interview_category_links.inter_id
JOIN categories ON interview_category_links.cat_id = categories.id
WHERE categories.category_safe = 'news'
ORDER BY date DESC
LIMIT 15
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE categories ALL PRIMARY,id NULL NULL NULL 16 Using where; Using temporary; Using filesort
1 SIMPLE interview_category_links ref inter_id,inter_id_2,cat_id cat_id 4 devel.categories.id 893
1 SIMPLE interviews eq_ref PRIMARY PRIMARY 4 devel.interview_category_links.in... 1
Sur la table des catégories Je l'index (id, cat_id) et sur la table interview_category_links j'ai deux (cat_id, inter_id) et des indices individuels ainsi (cat_id) et (inter_id)
Si n'importe qui peut faire la lumière sur ce que je serais très reconnaissant.
Merci Tom