# Count .... Group By... any other way?

**URL:** <https://forums.percona.com/t/count-group-by-any-other-way/97>\
**Category:** Other MySQL® Questions\
**Created:** [October 9, 2006, 10:06am UTC](https://forums.percona.com/t/count-group-by-any-other-way/97 "2006-10-09T10:06:32Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![MatejDJ](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matejdj/32/744_2.png) [@MatejDJ](https://forums.percona.com/u/MatejDJ)\
**Post date:** [October 9, 2006, 1:05pm UTC](https://forums.percona.com/t/count-group-by-any-other-way/97/3 "2006-10-09T13:05:27Z")

</div>

| [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. |

What should i use then?

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

---

_[View the full topic](https://forums.percona.com/t/count-group-by-any-other-way/97)._
