MSGCNTR-403 added forum statistics and grading
Occasionally, we see slow queries in MySQL because a bad query plan is chosen. MySQL uses the primary index instead of the much better secondary index. One possible reason is that the ORDER BY clauses in findReadMessagesForStudent causes query plan confusion.
The order by is completely unnecessary as the sorting is already done in Java code (messageforums-app/src/java/org/sakaiproject/tool/messageforums/ui/MessageForumStatisticsBean.java):