I would like to know the impact on performance if I run this query in the following conditions.
Query:
select `players`.*, count(`clicks`.`id`) as `clicks_count`
from `players` left join `clicks` on `clicks`.`player_id` = `players`.`id`
group by `players`.`id`
order by `clicks_count` desc
limit 1
Conditions:
- In the clicks table I expect to get insert 1000 times in a 1 minute
- The clicks table will contain more then 1,000,000 rows
- The players table will contain 10,000 rows
- The players table get inserted into every 5 minutes
I would like to know what to expect performance-wise if I run the query 1000 times in 1 minute.
Thanks
Trial and error!EXPLAINcan sometimes give you clues as to how your query is being done. Here's a friendly tree based version: xaprb.com/blog/2007/07/29/introducing-mysql-visual-explain