Part of query:
FROM
pm_data AS pmdata
LEFT JOIN messages as pm
ON pmdata.msg_id = pm.msg_id
LEFT JOIN users as usr
ON (usr.uid = pm.reciever_id || usr.uid = pm.sender_id)
WHERE
(
pmdata.sender_id = 541839243781
AND
pmdata.sender_isdeleted = 1
)
OR
(
pmdata.reciever_id = 541839243781
AND
pmdata.reciever_isDeleted = 1
)
ORDER BY pm.created_at DESC
at the moment i have only added
For this query only, useful indexes are:
This query does not need what you mentioned:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.