osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now
[resolved] Long thread tickets with slow page load time
I'm having problems with long thread tickets (>100 messages). I have only two of them and both won't load in less than 2-3 minutes at the agent's side.
During this loading, mysql takes both cores up to 100% and everything slows down. I have only about 1700 tickets.
In the slow queries log I always have the same query:
SELECT ticket.ticket_id as id ,count(DISTINCT attach.attach_id) as attachments ,count(DISTINCT message.id) as messages ,count(DISTINCT response.id) as responses ,count(DISTINCT note.id) as notes FROM sup_ticket ticket LEFT JOIN sup_ticket_attachment attach ON (ticket.ticket_id=attach.ticket_id) LEFT JOIN sup_ticket_thread message ON (ticket.ticket_id=message.ticket_id AND message.thread_type = 'M') LEFT JOIN sup_ticket_thread response ON (ticket.ticket_id=response.ticket_id AND response.thread_type = 'R') LEFT JOIN sup_ticket_thread note ON ( ticket.ticket_id=note.ticket_id AND note.thread_type = 'N') WHERE ticket.ticket_id=592 GROUP BY ticket.ticket_id;
# Time: 150604 7:17:23
# User@Host: company_support[company_support] @ localhost 
# Thread_id: 731 Schema: company_support Last_errno: 0 Killed: 0
# Query_time: 100.846179 Lock_time: 0.000174 Rows_sent: 1 Rows_examined: 55805113 Rows_affected: 0 Rows_read: 55805113
# Bytes_sent: 249
I tried moving from DB to files for attachments. I tried re-creating all databases and cleaning the ibdata files. Nothing helps.
OsTicket version is 220.127.116.11 (stable). I started experiencing this issue on the previous 1.9.8 version.
Please let me know if you have any thoughts on this. Thank you.