Добрый день!
Подскажите как оптимизировать данный MySQL запрос
SELECT registry.id, registry.reg_num, registry.reg_date, registry.Theme, registry.List_doc, registry.List_add, registry.Contractor, registry.type_send, registry.Send_date
FROM registry INNER JOIN recipients ON recipients.letterId = registry.id
WHERE registry.reg_date like '2016-12'
GROUP BY registry.id
ORDER BY registry.reg_num ASC
Иногда время запроса уходит в 15 секунд - что не есть хорошо
EXPLAIN
+----+-------------+------------+-------+-----------------------+----------+---------+------------------+------+----------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------+-------+-----------------------+----------+---------+------------------+------+----------------------------------------------+
| 1 | SIMPLE | registry | index | PRIMARY,LetterId,Date | PRIMARY | 4 | NULL | 47 | Using where; Using temporary; Using filesort |
| 1 | SIMPLE | recipients | ref | LetterId | LetterId | 4 | work.registry.id | 1 | Using index |
+----+-------------+------------+-------+-----------------------+----------+---------+------------------+------+----------------------------------------------+