Как вам такой MySQL запрос? Не будет ли она сильно нагружать БД? Как его можно оптимизировать?
SELECT D.id,sender_id,recipient_id,send_notifications, S.id AS sender_id, R.id AS recipient_id, R.name AS recipient_name, R.birthday AS recipient_birthday, R.status AS recipient_status, R.sex AS recipient_sex, R.last_activity_at AS recipient_last_activity_at, BS.id AS im_blakcklist, BR.id AS youare_blakcklist, LM.id AS last_message
FROM dialogs D
JOIN users S on S.id=IF(93=sender_id, sender_id, recipient_id)
JOIN users R on R.id=IF(93=recipient_id, sender_id, recipient_id)
LEFT JOIN blacklist BS on BS.uid=S.id and BS.who=R.id
LEFT JOIN blacklist BR on BR.uid=R.id and BR.who=S.id
WHERE ((sender_id=93 and recipient_id!=93) or (sender_id!=93 and recipient_id=93))
ORDER BY id DESC LIMIT 0,16