etwas übersichtlicher, was explain ausgibt...
Explain:
EXPLAIN SELECT DISTINCT a,b,c,.....
FROM res, res_text,
(
SELECT res_words.res_id, res_words.rank
FROM words, res_words
(A)
WHERE word LIKE '%irgendwas%'
(B)
AND words.id = res_words.word_id
) AS wort
WHERE server_id =1
(C)
AND res.id = res_text.res_id
(D) (woher kommt eigentlich (E)?)
AND res.id = wort.res_id
GROUP BY res.id
ORDER BY score DESC , id ASC
Ergebnis ist:
meine Bezeichnung|id|select_type|table|type|possible_keys|key|key_len|ref|rows|Extra
A|1|PRIMARY|<derived2>|ALL|NULL|NULL|NULL|NULL|35996|Using temporary; Using filesort
B|1|PRIMARY|res|eq_ref|PRIMARY|PRIMARY|8|wort.res_id|1|Using where
C|1|PRIMARY|res_text|eq_ref|PRIMARY|PRIMARY|8|node.res.id|1|--
D|2|DERIVED|words|All|PRIMARY|NULL|NULL|NULL|199878|Using where
E|2|DERIVED|res_words|ref|word_id|word_id|4|node.words.id|10