mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-22 18:43:33 +00:00
fix[sql]: move model_type first in JOIN for better index usage - (model_type, model_id)
This commit is contained in:
@@ -406,7 +406,7 @@ SELECT
|
||||
'[]'::json
|
||||
) AS attachments
|
||||
FROM conversation_messages m
|
||||
LEFT JOIN media ON media.model_id = m.id AND media.model_type = 'messages'
|
||||
LEFT JOIN media ON media.model_type = 'messages' AND media.model_id = m.id
|
||||
WHERE m.uuid = $1
|
||||
GROUP BY
|
||||
m.id, m.created_at, m.updated_at, m.status, m.type, m.content, m.uuid, m.private, m.sender_type
|
||||
|
||||
Reference in New Issue
Block a user