Sean Kendle
Member
We are continuously getting max connection errors on our site, (50k+ users per day), and the server admins pointed us to this query in your add-on, which is taking around 20 seconds to complete:
I've attached some screenshots.
Code:
SELECT conversation_master.*,
conversation_user.*,
conversation_starter.*,
conversation_recipient.recipient_state, conversation_recipient.last_read_date
FROM xf_conversation_user AS conversation_user
INNER JOIN xf_conversation_master AS conversation_master ON
(conversation_user.conversation_id = conversation_master.conversation_id)
INNER JOIN xf_conversation_recipient AS conversation_recipient ON
(conversation_user.conversation_id = conversation_recipient.conversation_id
AND conversation_user.owner_user_id = conversation_recipient.user_id)
LEFT JOIN xf_user AS conversation_starter ON
(conversation_starter.user_id = conversation_master.user_id)
ORDER BY conversation_user.last_message_date DESC
LIMIT 40;
I've attached some screenshots.
[tLk] ReadPC - TilkiBey_ReadPC_Model_ReadPC::getConversations
TilkiBey_ReadPC_Model_ReadPC::getConversations(array $conditions = array(), array $fetchOptions...
[tLk] ReadPC - Slow SQL Query
Query takes around 20 seconds to complete, leaving database connections open, and causing too...
Last edited: