[B]Quote:[/B] |
I also should ask you why are you trying to implement search engine in SQL ? It is going to be slow as you will have to traverse very many rows for common keywords. |
Here is EXPLAIN with COUNT … GROUP BY
id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE keyword2 range PRIMARY,keyword keyword 150 NULL 8 Using where; Using temporary; Using filesort1 SIMPLE keyword2_index ref keyword_id keyword_id 4 keyword2.id 21 Using where
Here is EXPLAIN without COUNT … GROUP BY
id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE keywordd range PRIMARY,keyword keyword 150 NULL 8 Using where1 SIMPLE keyword2_index ref keyword_id keyword_id 4 keyword2.id 21 Using where
Thank you!
Matej