我想从以下查询中显示一些有限的记录,但是我应该如何减少使用连接在查询中执行的 scan 的总数并加快执行速度?
询问::
select ml.*,m.title as medianame,mt.name as media_type,d.device_name as devicename,
SUBTIME(ml.end_time,ml.start_time) as playback_duration,d.client_id
from device_media_log ml left join media m on m.media_id = ml.media_id left join device d on d.device_id = ml.device_id
left join media_type mt on m.media_type_id = mt.media_type_id
order by ml.play_date desc,ml.start_time desc,ml.end_time desc;
所有表都包含必需的索引。