Mysql undriven table field sort unused index how to optimize

use multiple left join for association, but the sorted fields are not table-driven. Although indexed, they are useless. How to optimize them

< hr >
explain select ci.*,vr.video_delay,ir.icmp_status
FROM
    camera_info ci
LEFT JOIN vqd_result vr ON ci.device_id = vr.device_id
AND ci.tenant_id = vr.tenant_id
LEFT JOIN icmp_result ir ON ir.ip = ci.ipaddress
AND ci.tenant_id = ir.tenant_id
order by vr.video_get_time
-- order by ir.icmp_time
-- order by ci.create_time

must query all the fields of camera_info. If not, other tables are displayed as null, so they are associated with multiple left join, but the sorted fields may come from three tables. The three tables all have more than 200,000 data and query for more than 20 seconds. Try to add sort_buffer_size, but it doesn"t have much effect.

Aug.04,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a7c4-2c20e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a7c4-2c20e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?